mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-13 04:38:24 +00:00
Fix a subtle bug when removing instructions from memdep. In very specific
circumstances we could end up remapping a dependee to the same instruction that we're trying to remove. Handle this properly by just falling back to a conservative solution. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54132 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -528,6 +528,10 @@ void MemoryDependenceAnalysis::removeInstruction(Instruction* rem) {
|
|||||||
// If we have dep info for rem, set them to it
|
// If we have dep info for rem, set them to it
|
||||||
BasicBlock::iterator RI = depGraphEntry->second.first;
|
BasicBlock::iterator RI = depGraphEntry->second.first;
|
||||||
RI++;
|
RI++;
|
||||||
|
|
||||||
|
// If RI is rem, then we use rem's immediate successor.
|
||||||
|
if (RI == (BasicBlock::iterator)rem) RI++;
|
||||||
|
|
||||||
newDep = RI;
|
newDep = RI;
|
||||||
} else if ( (depGraphEntry->second.first == NonLocal ||
|
} else if ( (depGraphEntry->second.first == NonLocal ||
|
||||||
depGraphEntry->second.first == None ) &&
|
depGraphEntry->second.first == None ) &&
|
||||||
|
Reference in New Issue
Block a user