diff options
author | Bill Wendling <isanbard@gmail.com> | 2008-08-20 20:32:05 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2008-08-20 20:32:05 +0000 |
commit | fb018d0433f7b52c3f1235e675276adb1f92d597 (patch) | |
tree | d55de5a8da0c751c1b26650ba39146fe52fbe6dc | |
parent | cb34cd7b5e4de914c1177a683f9cbb146ad50634 (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.cpp | 9 |
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(); |