mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-10-19 19:12:56 +02:00
RegisterCoalescer: Improve previous fix for wrong def after.
The previous fix in r225503 was needlessly complicated. The problem goes away as well if the arguments to MergeValueNumberInto are supplied in the correct order. This was previously missed because the existing code already had the wrong order but an additional later Merge was hiding the bug for the main liverange VNI. llvm-svn: 229424
This commit is contained in:
parent
7bf5e9ba92
commit
56362c4e5b
@ -738,15 +738,14 @@ bool RegisterCoalescer::removeCopyByCommutingDef(const CoalescerPair &CP,
|
|||||||
continue;
|
continue;
|
||||||
DEBUG(dbgs() << "\t\tnoop: " << DefIdx << '\t' << *UseMI);
|
DEBUG(dbgs() << "\t\tnoop: " << DefIdx << '\t' << *UseMI);
|
||||||
assert(DVNI->def == DefIdx);
|
assert(DVNI->def == DefIdx);
|
||||||
BValNo = IntB.MergeValueNumberInto(BValNo, DVNI);
|
BValNo = IntB.MergeValueNumberInto(DVNI, BValNo);
|
||||||
for (LiveInterval::SubRange &S : IntB.subranges()) {
|
for (LiveInterval::SubRange &S : IntB.subranges()) {
|
||||||
VNInfo *SubDVNI = S.getVNInfoAt(DefIdx);
|
VNInfo *SubDVNI = S.getVNInfoAt(DefIdx);
|
||||||
if (!SubDVNI)
|
if (!SubDVNI)
|
||||||
continue;
|
continue;
|
||||||
VNInfo *SubBValNo = S.getVNInfoAt(CopyIdx);
|
VNInfo *SubBValNo = S.getVNInfoAt(CopyIdx);
|
||||||
assert(SubBValNo->def == CopyIdx);
|
assert(SubBValNo->def == CopyIdx);
|
||||||
VNInfo *Merged = S.MergeValueNumberInto(SubBValNo, SubDVNI);
|
S.MergeValueNumberInto(SubDVNI, SubBValNo);
|
||||||
Merged->def = CopyIdx;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ErasedInstrs.insert(UseMI);
|
ErasedInstrs.insert(UseMI);
|
||||||
|
Loading…
Reference in New Issue
Block a user