Fix for PR12090: clear def maps of aliases when visiting a copy. e.g.

%S5<def> = COPY %S0<kill>
First clear def map of Q1, etc.

No small test case available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151574 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2012-02-27 21:46:42 +00:00
parent 7b25ecf6ad
commit b266cd0e98

View File

@ -199,6 +199,11 @@ bool MachineCopyPropagation::CopyPropagateBlock(MachineBasicBlock &MBB) {
SourceNoLongerAvailable(Def, SrcMap, AvailCopyMap);
// Remember Def is defined by the copy.
// ... Make sure to clear the def maps of aliases first.
for (const unsigned *AS = TRI->getAliasSet(Def); *AS; ++AS) {
CopyMap.erase(*AS);
AvailCopyMap.erase(*AS);
}
CopyMap[Def] = MI;
AvailCopyMap[Def] = MI;
for (const unsigned *SR = TRI->getSubRegisters(Def); *SR; ++SR) {