aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
diff options
context:
space:
mode:
authorMichael Kuperstein <michael.m.kuperstein@intel.com>2015-08-12 10:14:58 +0000
committerMichael Kuperstein <michael.m.kuperstein@intel.com>2015-08-12 10:14:58 +0000
commitbc7f99a3ab802f4f5be6f3b0a97df03e6bfd3375 (patch)
treed38ad79676f320526b91fdd49d00f02429204ff4 /llvm/lib/Target/X86/X86CallFrameOptimization.cpp
parentc5746865296fc07bb7f985d44d14ce780ac12086 (diff)
downloadllvm-bc7f99a3ab802f4f5be6f3b0a97df03e6bfd3375.zip
llvm-bc7f99a3ab802f4f5be6f3b0a97df03e6bfd3375.tar.gz
llvm-bc7f99a3ab802f4f5be6f3b0a97df03e6bfd3375.tar.bz2
[X86] Allow x86 call frame optimization to fold more loads into pushes
This abstracts away the test for "when can we fold across a MachineInstruction" into the the MI interface, and changes call-frame optimization use the same test the peephole optimizer users. Differential Revision: http://reviews.llvm.org/D11945 llvm-svn: 244729
Diffstat (limited to 'llvm/lib/Target/X86/X86CallFrameOptimization.cpp')
-rw-r--r--llvm/lib/Target/X86/X86CallFrameOptimization.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
index 4fdb896..dd33c2e 100644
--- a/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
+++ b/llvm/lib/Target/X86/X86CallFrameOptimization.cpp
@@ -528,13 +528,10 @@ MachineInstr *X86CallFrameOptimization::canFoldIntoRegPush(
DefMI->getParent() != FrameSetup->getParent())
return nullptr;
- // Now, make sure everything else up until the ADJCALLSTACK is a sequence
- // of MOVs. To be less conservative would require duplicating a lot of the
- // logic from PeepholeOptimizer.
- // FIXME: A possibly better approach would be to teach the PeepholeOptimizer
- // to be smarter about folding into pushes.
+ // Make sure we don't have any instructions between DefMI and the
+ // push that make folding the load illegal.
for (auto I = DefMI; I != FrameSetup; ++I)
- if (I->getOpcode() != X86::MOV32rm)
+ if (I->isLoadFoldBarrier())
return nullptr;
return DefMI;