diff options
author | Lang Hames <lhames@gmail.com> | 2010-09-25 12:04:16 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2010-09-25 12:04:16 +0000 |
commit | 6e2968c85c1e162ee5bc813769eab223e3df0f15 (patch) | |
tree | 8c7b9a8fdb534794e6343b17ca5da22b416db723 /lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | 8db2defa839d8a510391ba28564b413c78326cda (diff) |
Removed VNInfo::isDefAccurate(). Def "accuracy" can be checked by testing whether LiveIntervals::getInstructionFromIndex(def) returns NULL.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114791 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index b29ea19835..65e21edee6 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -218,7 +218,7 @@ bool SimpleRegisterCoalescing::AdjustCopiesBackFrom(const CoalescerPair &CP, continue; LiveInterval &SRLI = li_->getInterval(*SR); SRLI.addRange(LiveRange(FillerStart, FillerEnd, - SRLI.getNextValue(FillerStart, 0, true, + SRLI.getNextValue(FillerStart, 0, li_->getVNInfoAllocator()))); } } @@ -267,7 +267,8 @@ bool SimpleRegisterCoalescing::HasOtherReachingDefs(LiveInterval &IntA, if (BI->valno == BValNo) continue; // When BValNo is null, we're looking for a dummy clobber-value for a subreg. - if (!BValNo && !BI->valno->isDefAccurate() && !BI->valno->getCopy()) + if (!BValNo && li_->getInstructionFromIndex(BI->valno->def) == 0 && + !BI->valno->getCopy()) continue; if (BI->start <= AI->start && BI->end > AI->start) return true; @@ -351,12 +352,11 @@ bool SimpleRegisterCoalescing::RemoveCopyByCommutingDef(const CoalescerPair &CP, assert(ALR != IntA.end() && "Live range not found!"); VNInfo *AValNo = ALR->valno; // If other defs can reach uses of this def, then it's not safe to perform - // the optimization. FIXME: Do isPHIDef and isDefAccurate both need to be - // tested? - if (AValNo->isPHIDef() || !AValNo->isDefAccurate() || - AValNo->isUnused() || AValNo->hasPHIKill()) - return false; + // the optimization. MachineInstr *DefMI = li_->getInstructionFromIndex(AValNo->def); + if (AValNo->isPHIDef() || DefMI == 0 || AValNo->isUnused() || + AValNo->hasPHIKill()) + return false; if (!DefMI) return false; const TargetInstrDesc &TID = DefMI->getDesc(); @@ -652,9 +652,8 @@ bool SimpleRegisterCoalescing::ReMaterializeTrivialDef(LiveInterval &SrcInt, assert(SrcLR != SrcInt.end() && "Live range not found!"); VNInfo *ValNo = SrcLR->valno; // If other defs can reach uses of this def, then it's not safe to perform - // the optimization. FIXME: Do isPHIDef and isDefAccurate both need to be - // tested? - if (ValNo->isPHIDef() || !ValNo->isDefAccurate() || + // the optimization. + if (ValNo->isPHIDef() || li_->getInstructionFromIndex(ValNo->def)==0 || ValNo->isUnused() || ValNo->hasPHIKill()) return false; MachineInstr *DefMI = li_->getInstructionFromIndex(ValNo->def); |