From b266cd0e9824db48804c785b2c48b43be0c0f7dd Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Mon, 27 Feb 2012 21:46:42 +0000 Subject: [PATCH] Fix for PR12090: clear def maps of aliases when visiting a copy. e.g. %S5 = COPY %S0 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 --- lib/CodeGen/MachineCopyPropagation.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/CodeGen/MachineCopyPropagation.cpp b/lib/CodeGen/MachineCopyPropagation.cpp index 9ed7b7357ed..8a9786d9cb9 100644 --- a/lib/CodeGen/MachineCopyPropagation.cpp +++ b/lib/CodeGen/MachineCopyPropagation.cpp @@ -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) {