forked from OSchip/llvm-project
[SSAUpdaterBulk] Fix linux bootstrap/sanitizer failures: explicitly specify order of evaluation.
The standard says that the order of evaluation of an expression s[x] = foo() is unspecified. In our case, we first create an empty entry in the map, then call foo(), then store its return value to the created entry. The problem is that foo uses the map as a cache, so if it finds that there is an entry in the map, it stops computation. This change explicitly sets the order, thus fixing this heisenbug. llvm-svn: 329864
This commit is contained in:
parent
cafa11289a
commit
4fbb93003b
|
@ -59,7 +59,8 @@ Value *SSAUpdaterBulk::computeValueAt(BasicBlock *BB, RewriteInfo &R,
|
|||
if (!R.Defines.count(BB)) {
|
||||
if (DT->isReachableFromEntry(BB) && PredCache.get(BB).size()) {
|
||||
BasicBlock *IDom = DT->getNode(BB)->getIDom()->getBlock();
|
||||
R.Defines[BB] = computeValueAt(IDom, R, DT);
|
||||
Value *V = computeValueAt(IDom, R, DT);
|
||||
R.Defines[BB] = V;
|
||||
} else
|
||||
R.Defines[BB] = UndefValue::get(R.Ty);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue