[lldb] Fix SymbolFilePDBTests after FileSpec change f9b5264523b1 (#208425)
GetDirectory() returns a StringRef now which doesn't convert to bool
implicitly
[GVN] Fix PHITransAddr crash scanning cross-function cast users (#211169)
When PHI-translating a load address through a select of module-level
constant expressions, the folded side becomes a global constant whose
use-list spans multiple functions. Scanning that use-list for an
available cast could return a cast from another function, which then
made DominatorTree::dominates() query a block from a different function
and trip an assertion.
This patch restricts the search to casts in the current function,
matching the existing guards on the GEP and add paths.
Fixes #211034
[flang][Lower][OpenMP] Fix reduction on array sections aborting in lowering (#209701)
**Summary**
This regression was introduced by #196094, which added a special
lowering path for reductions on a single array element, such as `a(2)`.
The problem is that Flang also treated an array section like `a(2:96)`
as if it were a single element. Because of this, the section was sent to
a code path that only supports scalar elements.
That path produced an array type that the reduction initialization code
could not handle, so Flang reached a `TODO` and aborted with a “not yet
implemented” error.
**Fix**
The fix is to use the special element path only when the expression has
[12 lines not shown]
[flang-rt] enable IsNamelistNameOrSlash lookahead for scalar namelist items
Problem
-------
An empty NAMELIST assignment on a scalar item — e.g. `l =` in
&nml l= i_count=7 r_value=2.72/
— aborted at runtime with
fatal Fortran runtime error: Bad character 'i' in LOGICAL input field
Every EditIntegerInput / EditRealInput / EditLogicalInput /
EditCharacterInput function starts its list-directed arm with
if (IsNamelistNameOrSlash(io)) return false; // no value
which peeks ahead (via SavedPosition, no stream consumption) for a
`<name>=` / `<name>%` / `<name>(` shape or one of the terminators
[21 lines not shown]
[AMDGPU] Make libc build backwards compatible (triple)
https://github.com/llvm/llvm-project/pull/210032 updated the triple but
did not introduce backwards compatibility, leading to, e.g., failing
check-offload tests due to missing libc.
Thread Safety Analysis: Don't warn at joins that re-branch on a try-lock result (#209796)
Previously, when the result of a try-lock call is branched on more than
once, the paths between the branches would disagree on whether the
capability is held while remaining consistent at each branch. The analysis
then gave a false positive warning at the intermediate join:
mutex 'lock' is not held on every path through here
Create getTerminatorTrylockCall() helper from getEdgeLockset(); if the terminator
of a block branches on the result of a call to a try_acquire_capability-function
(perhaps negated or stored in a local variable), this helper returns that call and
its callee.
Use this new helper in getTerminatorTrylockCaps(), which will return the
capabilities acquired by a trylock; feed these capabilites to intersectAndWarn()
during a branch join, in order to avoid false positives.
Soundness is preserved because intersectAndWarn() still removes the
[7 lines not shown]
[SDAG] Specify unsigned compares for loop.dependence.{war|raw} masks (#197437)
Previously, the LangRef was ambiguous about the sign of comparisons used
to create the loop dependence masks. This resulted in the expansion not
following the intended semantics for extreme inputs.
For example, %ptrA = 0, %ptrB = UINT_MAX, should result in a (RAW) mask
with all lanes active. However, previously we'd do ``(%elementSize *
lane) < abs(%ptrB - %ptrA)``, which due to incorrectly using signed
arithmetic would result in a mask with a single lane active as
``abs(%ptrB - %ptrA)`` resulted in 1, not `UINT_MAX`. In other words,
``abs(%ptrB - %ptrA)`` should be ``unsigned-absolute-difference(%ptrA,
%ptrB)``.
Follow up to #188248.
[lldb] Add array decaying (#210918)
In C, an array name in an expression "decays" into a pointer to its
first element. LLDB did not honor this: commands like `memory read
my_array` did not work correctly, because an aggregate type has no
scalar value, so trying to obtain one (ResolveValue/GetValueAsUnsigned)
failed.
This MR adds explicit array decay: for array-typed expressions, the
address of the array object itself is used instead of its (non-existent)
scalar value.
[RFC][AMDGPU] Add BARRIER address space
Add a new BARRIER address space that is used for global variables that are used to represent the barrier IDs in GFX12.5.
These barrier addresses just have values corresponding 1-1 to barrier IDs. They are still implemented on top of LDS, but the offsetting happens during an addrspacecast to generic, not whenever the barrier GV is used.
The motivation for this is to make the relation between LDS and barrier GVs explicit in the compiler. It does add a bit more complexity, but that complexity was already there, just hidden by pretending barrier GVs were actual LDS.
[AMDGPU] Add synthetic apertures and use them for barriers
Define what a synthetic aperture is, and adjust the barrier AS
to use this new system. This makes the barrier AS even safer to
use as now we can use all 32 bits of it without ever risking
hitting a valid address of any kind (LDS or outside LDS).
[libc++] Remove {Pause,Resume}Timing from fast push_back benchmarks (#209130)
These benchmarks are expected to run for a very short time, and
`{Pause,Resume}Timing` should only be used when operations are expected
to take a long time. Removing them reduces the amount of noise in these
benchmarks.
Fixes #208719
[AArch64][GlobalISel] Select vector element extract into GPR (#210030)
Prototyping a new minimal type-based approach to RegBankSelect (#199040)
for compile-time purposes exposed various gaps in instruction selection
when not using the existing RegBankSelect pass. These manifested as new
fallbacks when compiling the IR dataset from [1].
This patch teaches instruction selection to handle extracts of scalar
i8/i16/i32 into GPR directly. This will prevent new fallbacks being
introduced when a new type-based RBS pass is added.
The test cases are extracted from [1].
Assisted-by: codex
[1] https://davemgreen.github.io/gisel.html
[LoopInterchange] Prevent the transformation stage from stopping partway (#205564)
As mentioned in #205562, there are cases where the transformation stage
in LoopInterchange stops partway through, and the output IR ends up
partially modified rather than interchanged. Notably, the interchange is
recognized as having succeeded internally even in such cases. Apparently
this happens not to cause any miscompiles at the moment, but it is
clearly dangerous.
This patch removes the early exit in the transformation phase. We cannot
simply remove it, which checks for the presence of a unique successor of
the inner loop header, because there is a case where the header actually
has multiple successors. To avoid that situation, this patch changes the
code to call SplitBlock on the inner loop header unconditionally.
The test changes fall into two categories: some are simply due to newly
added redundant BBs. In the others, the expected interchanges are now
applied as intended, whereas previously the transformation failed and
the interchanges were not applied before this patch.