[PATCH] D45358: [AArch64] Use FP to access the emergency spill slot

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 12:27:39 PDT 2018


efriedma added inline comments.


================
Comment at: lib/Target/AArch64/AArch64FrameLowering.cpp:1005
       UseFP = hasFP(MF);
-    } else if (hasFP(MF) && !RegInfo->hasBasePointer(MF) &&
-               !RegInfo->needsStackRealignment(MF)) {
-      // Use SP or FP, whichever gives us the best chance of the offset
-      // being in range for direct access. If the FPOffset is positive,
-      // that'll always be best, as the SP will be even further away.
+    } else if (hasFP(MF) && !RegInfo->needsStackRealignment(MF)) {
       // If the FPOffset is negative, we have to keep in mind that the
----------------
Could this needsStackRealignment check cause problems similar to the bug you're fixing?


================
Comment at: lib/Target/AArch64/AArch64FrameLowering.cpp:1020
+          UseFP = PreferFP;
+        else if (!CanUseBP) // Can't use BP. Forced to use FP.
+          UseFP = true;
----------------
How did the !CanUseBP work before this patch?


https://reviews.llvm.org/D45358





More information about the llvm-commits mailing list