[clang] [llvm] [RegAlloc] [X86] Enable callee saved register optimization for x86 (PR #188609)

Phoebe Wang via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 8 00:04:18 PDT 2026


================
@@ -182,6 +182,11 @@ class X86RegisterInfo final : public X86GenRegisterInfo {
   bool requiresRegisterScavenging(const MachineFunction &MF) const override {
     return true;
   }
+
+  unsigned getCSRFirstUseCost() const override {
+    // push + pop.
+    return 2;
----------------
phoebewang wrote:

With PPX, push/pop won't go through memory. We should exclude for it.

https://github.com/llvm/llvm-project/pull/188609


More information about the cfe-commits mailing list