aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2008-08-20 20:32:05 +0000
committerBill Wendling <isanbard@gmail.com>2008-08-20 20:32:05 +0000
commitfb018d0433f7b52c3f1235e675276adb1f92d597 (patch)
treed55de5a8da0c751c1b26650ba39146fe52fbe6dc
parentcb34cd7b5e4de914c1177a683f9cbb146ad50634 (diff)
Don't hoist instructions that define a physical register.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55074 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/MachineLICM.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/MachineLICM.cpp b/lib/CodeGen/MachineLICM.cpp
index 302581f4dd..1ec32b5336 100644
--- a/lib/CodeGen/MachineLICM.cpp
+++ b/lib/CodeGen/MachineLICM.cpp
@@ -273,7 +273,14 @@ bool MachineLICM::IsLoopInvariantInst(MachineInstr &I) {
for (unsigned i = 0, e = I.getNumOperands(); i != e; ++i) {
const MachineOperand &MO = I.getOperand(i);
- if (!MO.isRegister() || !MO.isUse())
+ if (!MO.isRegister())
+ continue;
+
+ if (MO.isDef() && TargetRegisterInfo::isPhysicalRegister(MO.getReg()))
+ // Don't hoist an instruction that defines a physical register.
+ return false;
+
+ if (!MO.isUse())
continue;
unsigned Reg = MO.getReg();