[PATCH] D159536: [BOLT] Implement '--assume-abi' option for AArch64
Jiapeng Zhou via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 24 02:38:41 PDT 2023
Kepontry updated this revision to Diff 557279.
Kepontry added a comment.
Add a simple testcase.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D159536/new/
https://reviews.llvm.org/D159536
Files:
bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
bolt/test/assume-abi.test
Index: bolt/test/assume-abi.test
===================================================================
--- /dev/null
+++ bolt/test/assume-abi.test
@@ -0,0 +1,7 @@
+# Validate the usage of the `--assume-abi` option in conjunction with
+# CFG-related options.
+
+REQUIRES: system-linux
+
+RUN: %clang %cflags %p/Inputs/hello.c -o %t -Wl,-q
+RUN: llvm-bolt %t -o %t.bolt --assume-abi --indirect-call-promotion=all
Index: bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
===================================================================
--- bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
+++ bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
@@ -443,6 +443,21 @@
return true;
}
+ void getCalleeSavedRegs(BitVector &Regs) const override {
+ Regs |= getAliases(AArch64::X19);
+ Regs |= getAliases(AArch64::X20);
+ Regs |= getAliases(AArch64::X21);
+ Regs |= getAliases(AArch64::X22);
+ Regs |= getAliases(AArch64::X23);
+ Regs |= getAliases(AArch64::X24);
+ Regs |= getAliases(AArch64::X25);
+ Regs |= getAliases(AArch64::X26);
+ Regs |= getAliases(AArch64::X27);
+ Regs |= getAliases(AArch64::X28);
+ Regs |= getAliases(AArch64::LR);
+ Regs |= getAliases(AArch64::FP);
+ }
+
const MCExpr *getTargetExprFor(MCInst &Inst, const MCExpr *Expr,
MCContext &Ctx,
uint64_t RelType) const override {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159536.557279.patch
Type: text/x-patch
Size: 1406 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230924/383a8e86/attachment.bin>
More information about the llvm-commits
mailing list