PACIASP and PACIA LR, SP are equivalent from PAC point of view while PACIA is not a BTI landing pad.
Direct branch does not need a landing pad. If PACIA is available from v8.3, the unnecessary landing pads could be eliminated.
Another patch will improve the detection of the direct only calls.
Details
- Reviewers
tamas.petz kcc chill ostannard
Diff Detail
Event Timeline
llvm/lib/Target/AArch64/AArch64FrameLowering.cpp | ||
---|---|---|
940 ↗ | (On Diff #256025) |
Sorry, I meant do say, create in the prologue:
Then this BTI placrement pass could just check if (MBBI->getOpcode() == AArch64::PACIASP || MBBI->getOpcode() == AArch64::PACIBSP || MBBI->getOpcode() == AArch64::PACIA || MBBI->getOpcode() == AArch64::PACIB) return false; knowing that what needs to be done has already been done. |
941 ↗ | (On Diff #256025) | Could this be refactored in a separate function and shared with the similar code that signs outlined functions? |
llvm/lib/Target/AArch64/AArch64BranchTargets.cpp | ||
---|---|---|
134 | I don't find that simpler or logical at all. We have a function called addBTI and it *removes" a BTI?
|
Suggest using an explicit condition, to spare the reader back-inferencing what conditions could set HintNum to 32.