mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-10-25 10:27:04 +00:00
fix a SCCP miscompilation that could happen when a
forced constant is changed to a constant, we would end up adding the instruction to the wrong worklist, preventing it from being properly revisited. This fixes rdar://7832370 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100837 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -317,7 +317,10 @@ private:
|
||||
void markConstant(LatticeVal &IV, Value *V, Constant *C) {
|
||||
if (!IV.markConstant(C)) return;
|
||||
DEBUG(dbgs() << "markConstant: " << *C << ": " << *V << '\n');
|
||||
InstWorkList.push_back(V);
|
||||
if (IV.isOverdefined())
|
||||
OverdefinedInstWorkList.push_back(V);
|
||||
else
|
||||
InstWorkList.push_back(V);
|
||||
}
|
||||
|
||||
void markConstant(Value *V, Constant *C) {
|
||||
@@ -327,9 +330,13 @@ private:
|
||||
|
||||
void markForcedConstant(Value *V, Constant *C) {
|
||||
assert(!V->getType()->isStructTy() && "Should use other method");
|
||||
ValueState[V].markForcedConstant(C);
|
||||
LatticeVal &IV = ValueState[V];
|
||||
IV.markForcedConstant(C);
|
||||
DEBUG(dbgs() << "markForcedConstant: " << *C << ": " << *V << '\n');
|
||||
InstWorkList.push_back(V);
|
||||
if (IV.isOverdefined())
|
||||
OverdefinedInstWorkList.push_back(V);
|
||||
else
|
||||
InstWorkList.push_back(V);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user