summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2012-02-25 02:01:00 +0000
committerLang Hames <lhames@gmail.com>2012-02-25 02:01:00 +0000
commitd5862ce31774754cede1eec50535249f1b1e8c88 (patch)
tree5ed5c022da00caf8adf4b7359cf8be7a10062169
parent01c047e00359e727f52d8576efb98f22454727f1 (diff)
downloadbcm5719-llvm-d5862ce31774754cede1eec50535249f1b1e8c88.tar.gz
bcm5719-llvm-d5862ce31774754cede1eec50535249f1b1e8c88.zip
Make the peephole optimizer clear kill flags on a vreg if it's about to add new
uses of the vreg, since the old kills may no longer be valid. This was causing -verify-machineinstrs to complain about uses after kills, and could potentially have been causing subtle register allocation issues, but I haven't come across a test case yet. llvm-svn: 151425
-rw-r--r--llvm/lib/CodeGen/PeepholeOptimizer.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/PeepholeOptimizer.cpp b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
index 203f2bffb7b..9c5c029000c 100644
--- a/llvm/lib/CodeGen/PeepholeOptimizer.cpp
+++ b/llvm/lib/CodeGen/PeepholeOptimizer.cpp
@@ -237,6 +237,10 @@ OptimizeExtInstr(MachineInstr *MI, MachineBasicBlock *MBB,
if (PHIBBs.count(UseMBB))
continue;
+ // About to add uses of DstReg, clear DstReg's kill flags.
+ if (!Changed)
+ MRI->clearKillFlags(DstReg);
+
unsigned NewVR = MRI->createVirtualRegister(RC);
BuildMI(*UseMBB, UseMI, UseMI->getDebugLoc(),
TII->get(TargetOpcode::COPY), NewVR)
OpenPOWER on IntegriCloud