[llvm] r329797 - [AArch64] Fix regression after r329691
Francis Visoiu Mistrih via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 11 05:36:55 PDT 2018
Author: thegameg
Date: Wed Apr 11 05:36:55 2018
New Revision: 329797
URL: http://llvm.org/viewvc/llvm-project?rev=329797&view=rev
Log:
[AArch64] Fix regression after r329691
In r329691, we would choose FP even if the offset wouldn't fit, just
because the offset is smaller than the one from BP. This made many
accesses through FP need to scavenge a register, which resulted in
slower and bigger code for no good reason.
This patch now always picks the offset that fits first, even if FP is
preferred.
Modified:
llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.cpp
Modified: llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.cpp?rev=329797&r1=329796&r2=329797&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64FrameLowering.cpp Wed Apr 11 05:36:55 2018
@@ -1052,7 +1052,7 @@ int AArch64FrameLowering::resolveFrameIn
// else we can use BP and FP, but the offset from FP won't fit.
// That will make us scavenge registers which we can probably avoid by
// using BP. If it won't fit for BP either, we'll scavenge anyway.
- } else if (PreferFP || FPOffset >= 0) {
+ } else if (FPOffset >= 0) {
// 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.
More information about the llvm-commits
mailing list