mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-17 20:23:59 +00:00
if jump threading is able to infer interesting values on both
the LHS and RHS of an and/or instruction, don't multiply add known predecessor values. This fixes the crash on testcase from PR7498 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108114 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -346,8 +346,19 @@ ComputeValueKnownInPredecessors(Value *V, BasicBlock *BB,PredValueInfo &Result){
|
||||
}
|
||||
for (unsigned i = 0, e = RHSVals.size(); i != e; ++i)
|
||||
if (RHSVals[i].first == InterestingVal || RHSVals[i].first == 0) {
|
||||
Result.push_back(RHSVals[i]);
|
||||
Result.back().first = InterestingVal;
|
||||
// If we already inferred a value for this block on the LHS, don't
|
||||
// re-add it.
|
||||
bool HasValue = false;
|
||||
for (unsigned r = 0, e = Result.size(); r != e; ++r)
|
||||
if (Result[r].second == RHSVals[i].second) {
|
||||
HasValue = true;
|
||||
break;
|
||||
}
|
||||
|
||||
if (!HasValue) {
|
||||
Result.push_back(RHSVals[i]);
|
||||
Result.back().first = InterestingVal;
|
||||
}
|
||||
}
|
||||
return !Result.empty();
|
||||
}
|
||||
|
Reference in New Issue
Block a user