diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-08-18 00:33:49 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-08-18 00:33:49 +0000 |
commit | d3361e996b272084d8ebe5bae8a0d420206c8e37 (patch) | |
tree | a0c373a9516731b38e72bd0ea9bc70dcddbfa201 | |
parent | e86389dd2afda2b9b4964d6fd5b2f32891722939 (diff) |
Don't hoist instructions that have implicit uses or defines. Before, it was
hoisting out some "test" and "cmp" instructions. This was obvious badness.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54908 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/MachineLICM.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/MachineLICM.cpp b/lib/CodeGen/MachineLICM.cpp index 758f42a3f5..302581f4dd 100644 --- a/lib/CodeGen/MachineLICM.cpp +++ b/lib/CodeGen/MachineLICM.cpp @@ -264,6 +264,11 @@ bool MachineLICM::IsLoopInvariantInst(MachineInstr &I) { } }); + if (I.getDesc().getImplicitDefs() || I.getDesc().getImplicitUses()) { + DOUT << "Cannot hoist with implicit defines or uses\n"; + return false; + } + // The instruction is loop invariant if all of its operands are. for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) { const MachineOperand &MO = I.getOperand(i); |