summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/MachineLICM.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-08-18 00:33:49 +0000
committerBill Wendling <isanbard@gmail.com>2008-08-18 00:33:49 +0000
commitcf596eb12f74f28d20194b6f8853e1a4b8ed5544 (patch)
treea9cc40f6b2290884b83e3fd504340a2fa3e296d1 /llvm/lib/CodeGen/MachineLICM.cpp
parent75d4a83f2f9db7635e8e268d0524e9dd33a445c0 (diff)
downloadbcm5719-llvm-cf596eb12f74f28d20194b6f8853e1a4b8ed5544.tar.gz
bcm5719-llvm-cf596eb12f74f28d20194b6f8853e1a4b8ed5544.zip
Don't hoist instructions that have implicit uses or defines. Before, it was
hoisting out some "test" and "cmp" instructions. This was obvious badness. llvm-svn: 54908
Diffstat (limited to 'llvm/lib/CodeGen/MachineLICM.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineLICM.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index 758f42a3f5d..302581f4dd5 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/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);
OpenPOWER on IntegriCloud