summaryrefslogtreecommitdiff
path: root/lib/CodeGen/PHIElimination.cpp
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2009-07-23 04:34:03 +0000
committerLang Hames <lhames@gmail.com>2009-07-23 04:34:03 +0000
commit287b8b0301bc6ec7eb70d23d242326a8766bb8eb (patch)
treef998afc5fd7e708b96f08692fd0e6c79ad8caeec /lib/CodeGen/PHIElimination.cpp
parent5fe2b03779908eab307488727d1b1a37128d7caa (diff)
downloadllvm-287b8b0301bc6ec7eb70d23d242326a8766bb8eb.tar.gz
llvm-287b8b0301bc6ec7eb70d23d242326a8766bb8eb.tar.bz2
llvm-287b8b0301bc6ec7eb70d23d242326a8766bb8eb.tar.xz
Added PHI Def & Kill tracking to PHIElimination pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76849 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/PHIElimination.cpp')
-rw-r--r--lib/CodeGen/PHIElimination.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/CodeGen/PHIElimination.cpp b/lib/CodeGen/PHIElimination.cpp
index dc799e8c27..1cbe798945 100644
--- a/lib/CodeGen/PHIElimination.cpp
+++ b/lib/CodeGen/PHIElimination.cpp
@@ -182,6 +182,10 @@ void llvm::PHIElimination::LowerAtomicPHINode(
TII->copyRegToReg(MBB, AfterPHIsIt, DestReg, IncomingReg, RC, RC);
}
+ // Record PHI def.
+ //assert(!hasPHIDef(DestReg) && "Vreg has multiple phi-defs?");
+ //PHIDefs[DestReg] = &MBB;
+
// Update live variable information if there is any.
LiveVariables *LV = getAnalysisIfAvailable<LiveVariables>();
if (LV) {
@@ -223,6 +227,13 @@ void llvm::PHIElimination::LowerAtomicPHINode(
assert(TargetRegisterInfo::isVirtualRegister(SrcReg) &&
"Machine PHI Operands must all be virtual registers!");
+ // Get the MachineBasicBlock equivalent of the BasicBlock that is the source
+ // path the PHI.
+ MachineBasicBlock &opBlock = *MPhi->getOperand(i*2+2).getMBB();
+
+ // Record the kill.
+ //PHIKills[SrcReg].insert(&opBlock);
+
// If source is defined by an implicit def, there is no need to insert a
// copy.
MachineInstr *DefMI = MRI->getVRegDef(SrcReg);
@@ -231,10 +242,6 @@ void llvm::PHIElimination::LowerAtomicPHINode(
continue;
}
- // Get the MachineBasicBlock equivalent of the BasicBlock that is the source
- // path the PHI.
- MachineBasicBlock &opBlock = *MPhi->getOperand(i*2+2).getMBB();
-
// Check to make sure we haven't already emitted the copy for this block.
// This can happen because PHI nodes may have multiple entries for the same
// basic block.