diff options
author | Owen Anderson <resistor@mac.com> | 2008-03-12 04:22:57 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-03-12 04:22:57 +0000 |
commit | 944b1c76ab119357559fb644bb024ac40931d8a2 (patch) | |
tree | 8de20be611c279c1fc3a9afaa74e75c2ba870927 | |
parent | 70aaab6dc51a2e11449c6707837a34222717ccaa (diff) | |
download | bcm5719-llvm-944b1c76ab119357559fb644bb024ac40931d8a2.tar.gz bcm5719-llvm-944b1c76ab119357559fb644bb024ac40931d8a2.zip |
We also need to collect the VN IDs for the PHI instructions for later updating.
llvm-svn: 48278
-rw-r--r-- | llvm/lib/CodeGen/StrongPHIElimination.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/StrongPHIElimination.cpp b/llvm/lib/CodeGen/StrongPHIElimination.cpp index 6467afe28f2..9dd7ddc62d0 100644 --- a/llvm/lib/CodeGen/StrongPHIElimination.cpp +++ b/llvm/lib/CodeGen/StrongPHIElimination.cpp @@ -52,8 +52,12 @@ namespace { std::set<unsigned> UsedByAnother; // RenameSets are the sets of operands (and their VNInfo IDs) to a PHI - // (the defining instruction of the key) that can be renamed without copies + // (the defining instruction of the key) that can be renamed without copies. std::map<unsigned, std::map<unsigned, unsigned> > RenameSets; + + // PhiValueNumber holds the ID numbers of the VNs for each phi that we're + // eliminating, indexed by the register defined by that phi. + std::map<unsigned, unsigned> PhiValueNumber; // Store the DFS-in number of each block DenseMap<MachineBasicBlock*, unsigned> preorder; @@ -405,6 +409,11 @@ void StrongPHIElimination::processBlock(MachineBasicBlock* MBB) { while (P != MBB->end() && P->getOpcode() == TargetInstrInfo::PHI) { unsigned DestReg = P->getOperand(0).getReg(); + LiveInterval& PI = LI.getOrCreateInterval(DestReg); + unsigned pIdx = LI.getInstructionIndex(P); + VNInfo* PVN = PI.getLiveRangeContaining(pIdx)->valno; + PhiValueNumber.insert(std::make_pair(DestReg, PVN->id)); + // PHIUnion is the set of incoming registers to the PHI node that // are going to be renames rather than having copies inserted. This set // is refinded over the course of this function. UnionedBlocks is the set |