diff options
author | Chris Lattner <sabre@nondot.org> | 2008-01-10 22:35:15 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-01-10 22:35:15 +0000 |
commit | 244588820867ab4e42f72c266196b848919bfebb (patch) | |
tree | 3d5ffdbe5eb27f91255e876448f6451893182951 /lib/CodeGen/MachineSink.cpp | |
parent | b38bec222c2cda1b905084400b9e91afbc30f985 (diff) |
Clamp down on sinking of lots of instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45841 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/MachineSink.cpp')
-rw-r--r-- | lib/CodeGen/MachineSink.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineSink.cpp b/lib/CodeGen/MachineSink.cpp index c832f0a65c..b83d844a16 100644 --- a/lib/CodeGen/MachineSink.cpp +++ b/lib/CodeGen/MachineSink.cpp @@ -130,6 +130,15 @@ bool MachineSinking::ProcessBlock(MachineBasicBlock &MBB) { /// SinkInstruction - Determine whether it is safe to sink the specified machine /// instruction out of its current block into a successor. bool MachineSinking::SinkInstruction(MachineInstr *MI) { + const TargetInstrDesc &TID = MI->getDesc(); + + // Ignore stuff that we obviously can't sink. + if (TID.mayStore() || TID.isCall() || TID.isReturn() || TID.isBranch()) + return false; + + if (TID.mayLoad()) + return false; + // Don't sink things with side-effects we don't understand. if (TII->hasUnmodelledSideEffects(MI)) return false; |