[BOLT][NFC] Rename Pointer Auth DWARF rewriter passes
Original names were "working titles". After initial patches are merged,
I'd like to rename these passes to names that reflect their intent
better and show their relationship to each other:
InsertNegateRAStatePass renamed to PointerAuthCFIFixup,
MarkRAStates renamed to PointerAuthCFIAnalyzer.
[BOLT][PAC] Warn about synchronous unwind tables
BOLT currently ignores functions with synchronous PAuth DWARF info.
When more than 10% of functions get ignored for inconsistencies, we
should emit a warning to only use asynchronous unwind tables.
See also: #165215
[BOLT] Improve InsertNegateRAStatePass::inferUnknownStates
Previous implementation used a simple heuristic. This can be improved in
several ways:
- If a BasicBlock has instruction both with known RAState and unknown RAState,
use the known states to work out the unknown ones.
- If a BasicBlock only consists of instructions with unknown RAState,
use the last known RAState from its predecessors, or the first known
from its successors to set the RAStates in the BasicBlock. This includes
error checking: all predecessors/successors should have the same RAState.
- Some BasicBlocks may only contain instructions with unknown RAState,
and have no CFG neighbors. These already have incorrect unwind info.
For these, we copy the last known RAState based on the layout order.
Updated bolt/docs/PacRetDesign.md to reflect changes.
[BOLT] Single-pass unittest for InsertNegateRAState
This commit creates a new directory: bolt/unittests/Passes, to be used
by unittests that need to register and run passes with the
BinaryFunctionPassManager.
An example test is created for InsertNegateRAState pass. Actual tests
will be added in followup commits.
[BOLT] Bugfix: use getFirstNonPseudo() instead of begin()
RA states are only assigned to non-pseudo instructions. Because of this,
CFI instructions are skipped.
Here, I incorrectly used begin(), not skipping CFIs.
[BOLT] Review changes
- remove unused PrevInst
- add a static PassFailed, and createFatalBOLTError() if the pass failed
on any of the threads executed in parallel. This is the same way
ADRRelaxationPass handles errors in threads.
[BOLT] Change RAState helpers (NFCI)
- unify isRAStateSigned and isRAStateUnsigned to a common getRAState,
- unify setRASigned and setRAUnsigned into setRAState(MCInst, bool),
- update users of these to match the new implementations.
[AMDGPU] Remove calling conv check on entry function
It is undefined behavior to call a function with a
mismatched calling convention. Rather than crash on
this behavior, it should compile.
[HLSL][SPIRV] Add error test for unpackhalf2x16 (#166969)
Add an error test to check that a suitable error diagnostic is generated
for the use of the GL::unpackhalf2x16 operation in
invalid contexts.
Fixes #166965
Co-authored-by: Tim Corringham <tcorring at amd.com>
[mlir] Dialect Conversion: Fix expensive pattern check in no-rollback mode (#166576)
Fixes a bug causing every conversion to fail fatally with "expected
pattern to replace the root operation or modify it in place" when
`MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS` is enabled and pattern
rollback is disabled.
When `allowPatternRollback` is disabled, the rewriter does not keep
track of the rewrites it performs and can therefore not use that list to
check whether the root op was replaced or updated in place.
[clang][DebugInfo] Attach `DISubprogram` to additional call variants (#166202)
`DISubprogram`s are attached to call sites to support various debug info
features, including entry values and tail calls. Clang 9.0
(0f6516856670a435461f56a9faeb4aa8a35a6679) was the first version to
include this kind of call site `DISubprogram` attachment.
This earlier work appears to visit only some call site variants,
however. The call site attachment was added to a higher-level `EmitCall`
path in Clang's code gen that is only used by some call variants. In
particular, some C++ member calls use a different code gen path, which
did not include this call site attachment step, and thus the debug info
it triggers (e.g. call site entries) was not emitted for such calls.
This moves `DISubprogram` attachment to a lower-level call emission path
that is used by all call variants.
Fixes https://github.com/llvm/llvm-project/issues/161962
[C2y] Claim nonconformance to WG14 N3348 (#166966)
This paper allows use of * in a multidimensional array extent within a
_Generic selection association, as a wildcard for any array extent.
Clang does not currently support this feature, so this is just some
initial test coverage along with an update to the conformance site.
For emitEpilogue, emitCSRSpillRestores' argument in FPSaved case to handle chain functions in same way as non-FPSaved case, an offset. Remove prior hardcode to s33 and do not restore FP for chain functions.
[AMDGPU] Initialize FrameOffsetReg for amdgpu_cs_chain functions
Functions with the amdgpu_cs_chain calling convention were not
initializing FrameOffsetReg, leaving it as FP_REG.
This caused machine code verification failures
as SCRATCH_STORE_DWORD_SADDR instructions require the saddr
operand to be in the SReg_32_XEXEC_HI register class.
This LLVM defect was identified via the AMD Fuzzing project.