[clang] [llvm] [RegAlloc] [X86] Enable callee saved register optimization for x86 (PR #220090)
David Li via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 2 09:11:20 PDT 2026
================
@@ -1296,3 +1296,13 @@ bool X86RegisterInfo::isNonRex2RegClass(const TargetRegisterClass *RC) const {
return true;
}
}
+
+unsigned X86RegisterInfo::getCSRFirstUseCost(const MachineFunction &MF) const {
+ // If PPX is implemented, push/pop pairs don't access memory.
+ const X86Subtarget &ST = MF.getSubtarget<X86Subtarget>();
+ if (ST.is64Bit() && ST.hasPPX())
+ return 0;
+
+ // push + pop.
----------------
david-xl wrote:
Better controlled by an option instead of hard coded with 2.
https://github.com/llvm/llvm-project/pull/220090
More information about the cfe-commits
mailing list