[StaticDataLayout] Reconcile string literal hotness from data access profiles and PGO profiles. (#178336)
https://github.com/llvm/llvm-project/pull/178333 updates the memprof
pass to annotate string literal section prefix.
The StaticDataProfileInfo.cpp provides an analysis pass to reconcile
global variable hotness. It's used by StaticDataAnnotator and AsmPrinter
to look up global variable hotness.
This PR updates the analysis pass to compute the hotness of string
literals.
* When both data access profiles and pgo counters provide a hotness
attribute, use the hotter one.
* Otherwise, use the hotness attribute that's available.
Implementation-wise, the option `AnnotateStringLiteralSectionPrefix` is
moved from MemProf (a transform pass) to StaticDataProfileInfo (an
Analysis pass). Otherwise, there might be errors like caught by CI. Note
https://github.com/llvm/llvm-project/pull/178336#issuecomment-3808537817
[11 lines not shown]
[mlir][AMDGPU] Add wrappers for in-memory barriers on gfx1250 (#180112)
This commit introduces the `!amdgpu.ds_barrier_state` type and
operations on that type, including extracting its components and (more
importantly) provides wrappers around the upcoming barrier-management
instructions that will be added in gfx1250.
This commit is loosely based on work done for Triton, but this commit
provides slightly more lower level-primitives (namely a known-atomic
load for getting the barrier state instead of providing a `wait`
operation that includes an entire spin-loop, though if people want one
we could consider adding it.) These operations will allow LDS barriers
to be interacted with in a more type-safe manner.
The types and operations use the Ds naming scheme to match the
underlying instructions and to avoid confusion with the "LDS barrier"
already present in the AMDGPU dialect that was a workaround for LLVM's
memory fencing support.
[6 lines not shown]
[mlir][gpu] Add NoMemoryEffect to gpu.subgroup_reduce op (#180227)
Add missing MemoryEffectOpInterface to gpu.subgroup_reduce
Signed-off-by: Fabrizio Indirli <fabrizio.indirli at arm.com>
Revert "[lldb-dap] fix executable substitution in tests (#179685)" (#180241)
This reverts commit 082a47d8944da242993bf28980b07f2c8c3df4a6.
`ToolSubst` should only be used explicitely for passing `extra_args`.
[SCEVExp] Use SCEVPtrToAddr in tryToReuseLCSSAPhi if possible. (#178727)
This patch updates tryToReuseLCSSAPhi to use SCEVPtrToAddr, unless using
SCEVPtrToInt allows re-use, because the IR already contains a re-usable
phi using PtrToInt.
This is a first step towards migrating to SCEVPtrToAddr and avoids
regressions in follow-up changes.
PR: https://github.com/llvm/llvm-project/pull/178727
[llvm][.gitignore] macOS case-sensitive update (#177971)
If you run macOS on a case-sensitive file system, .DS_store and .DS_Store are different files and the existing lowercase-s version doesn't match. Fix that with the intended case sensitive.
[flang] Add warning and documentation for extension (#179708)
When a pointer component has no default initialization in the derived
type definition and does not appear explicitly as a component in a
structure constructor, we assume that it is meant to be NULL() as an
extension. But there's no warning or documentation for this extension;
add them.
Fixes https://github.com/llvm/llvm-project/issues/179580.
[flang][CUDA] Better analysis of actual argument CUDA data attrs (#179569)
When checking an actual argument for any CUDA data attributes, be sure
to check the symbols in a designator like a%b%c in order, taking the
last symbol that has a CUDA attribute. And be sure to interpret a
function result symbol of a device function as a device object, at least
for generic interface resolution for defined assignments and operators.
This patch exposed errors in flang/test/Semantics/bug1214.cuf, which
have been fixed.
[flang] Refactor "unused"/"used without definition" warnings (#179539)
I'm emitting a false warning "used without definition" warning for
variable cited in an inquiry intrinsic (e.g. LBOUND), and failing to
emit an "unused local" warning for allocatables that only appear in
ALLOCATE statements.
This patch makes the analysis more context-aware by rewriting it in
terms of typed expression traversal, and moves the analysis part into
Evaluate/check-expression.cpp from Semantics/expression.cpp.
[flang] Better "out of memory" error for failure to allocate a unit (#179291)
When the I/O runtime fails to allocate storage for an I/O unit, the
error message cites a source location in the runtime library, not the
user program. Thread instances of Terminator through to the code that
attempts the allocation so that the failure has a source position in the
user's program.
AMDGPU: Use promotion to f32 path for log/log10 for f16 by default
While the current implementation passes OpenCL conformance, it is not
correctly rounded with an error of 1.79 ulp according to the conformance
test. Default to the promotion path without afn. In the future we should
make use of !fpmath metadata but that's not wired into the backend, or
from any frontend producer.
[msan] Switch switch() from strict handling to (icmp eq)-style handling (#179851)
Currently, the SwitchInst:
```
switch i32 %Val, label %else [ i32 0, label %A
i32 1, label %B
i32 2, label %C ]
```
is strictly handled i.e., MSan will check that %Val is fully
initialized. This is appropriate nearly all the time.
However, sometimes the compiler may convert (icmp + br) into a switch
statement. (icmp + br) has different semantics: MSan allows icmp eq/ne
with partly initialized inputs to still result in a fully initialized
output, if there exists a bit that is initialized in both inputs with a
differing value e.g., suppose:
```
%A = 0000000000001010
%B = 0000000000000110
[18 lines not shown]
[NFC][LLVM] Code cleanup in VNCoercion (#180159)
Use namespace qualifiers to define functions declared in the
`VNCoercion` namespace to conform to LLVM CS.
[RISCV] Add ppair.e and ppaire.w as aliases for pack on RV32 and RV64 respectively (#180100)
Based on this note from
https://jhauser.us/RISCV/ext-P/RVP-baseInstrs-018.pdf
(*1) For RV32, PPAIRE.H is a pseudoinstruction for PACK.
(*2) For RV64, PPAIRE.W is a pseudoinstruction for PACK.
[lldb][ClangUserExpression] Emit workaround hint when trying to call function templates (#179916)
Before:
```
(lldb) expression some_template_func<int, long>(5)
˄
╰─ error: 'some_template_func' does not name a template but is followed by template arguments
note: Ran expression as 'C++14'.
note: note: non-template declaration found by name lookup
```
After:
```
(lldb) expression some_template_func<int, long>(5)
˄
╰─ error: 'some_template_func' does not name a template but is followed by template arguments
note: Ran expression as 'C++14'.
note: note: non-template declaration found by name lookup
note: Naming template instantiation not yet supported. Template functions can be invoked via their mangled name. E.g., expression _Z3fooIiEvi(5)
[20 lines not shown]
[clang][OpenMP][test] Use `-fopenmp=libomp` explicitly (#180221)
Using `-fopenmp` uses the default openmp lib, which defaults to `libomp`
but may be something else. This test only passes with `libomp`, so it
passes when using all defaults, but fails downstream if configured for
something else, like `libgomp`.
[SelectionDAG] Use -filetype=null for llc RUN lines in pr142937 (#180004)
This patch adds -filetype=null to the llc RUN lines in pr142937.ll, to
ensure that the test does not attempt to write files to the local
directory.
Follow-up to #179249.