aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorJakob Stoklund Olesen <stoklund@2pi.dk>2010-02-15 22:03:29 +0000
committerJakob Stoklund Olesen <stoklund@2pi.dk>2010-02-15 22:03:29 +0000
commitfcda7188895dcf339e281d59a234ac0b06370758 (patch)
tree7ed4d14fc52d51a564db51403cfcf344dd2728f8 /lib/CodeGen
parent4fc82c13e83ab7c641ace85d6bfc06dc9e33701f (diff)
downloadexternal_llvm-fcda7188895dcf339e281d59a234ac0b06370758.tar.gz
external_llvm-fcda7188895dcf339e281d59a234ac0b06370758.tar.bz2
external_llvm-fcda7188895dcf339e281d59a234ac0b06370758.zip
Fix PR6300.
A virtual register can be used before it is defined in the same MBB if the MBB is part of a loop. Teach the implicit-def pass about this case. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96279 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/ProcessImplicitDefs.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/CodeGen/ProcessImplicitDefs.cpp b/lib/CodeGen/ProcessImplicitDefs.cpp
index e3df2e42cf..d7179b3e59 100644
--- a/lib/CodeGen/ProcessImplicitDefs.cpp
+++ b/lib/CodeGen/ProcessImplicitDefs.cpp
@@ -205,10 +205,9 @@ bool ProcessImplicitDefs::runOnMachineFunction(MachineFunction &fn) {
// Process each use instruction once.
for (MachineRegisterInfo::use_iterator UI = mri_->use_begin(Reg),
UE = mri_->use_end(); UI != UE; ++UI) {
- MachineInstr *RMI = &*UI;
- MachineBasicBlock *RMBB = RMI->getParent();
- if (RMBB == MBB)
+ if (UI.getOperand().isUndef())
continue;
+ MachineInstr *RMI = &*UI;
if (ModInsts.insert(RMI))
RUses.push_back(RMI);
}