uint32_t e = assignExpNewValueNum(exp).first;
valueNumbering[C] = e;
return e;
- } else if (MD && AA->onlyReadsMemory(C) &&
- // FIXME: Currently the calls which may access the thread id may
- // be considered as not accessing the memory. But this is
- // problematic for coroutines, since coroutines may resume in a
- // different thread. So we disable the optimization here for the
- // correctness. However, it may block many other correct
- // optimizations. Revert this one when we detect the memory
- // accessing kind more precisely.
- !C->getFunction()->isPresplitCoroutine()) {
+ }
+
+ if (MD && AA->onlyReadsMemory(C) &&
+ // FIXME: Currently the calls which may access the thread id may
+ // be considered as not accessing the memory. But this is
+ // problematic for coroutines, since coroutines may resume in a
+ // different thread. So we disable the optimization here for the
+ // correctness. However, it may block many other correct
+ // optimizations. Revert this one when we detect the memory
+ // accessing kind more precisely.
+ !C->getFunction()->isPresplitCoroutine()) {
Expression exp = createExpr(C);
auto ValNum = assignExpNewValueNum(exp);
if (ValNum.second) {
uint32_t v = lookupOrAdd(cdep);
valueNumbering[C] = v;
return v;
- } else {
- valueNumbering[C] = nextValueNumber;
- return nextValueNumber++;
}
+
+ valueNumbering[C] = nextValueNumber;
+ return nextValueNumber++;
}
/// Returns true if a value number exists for the specified value.
return true;
}
return false;
- } else if (isa<Constant>(V)) {
+ }
+
+ if (isa<Constant>(V)) {
// If it's not false, and constant, it must evaluate to true. This means our
// assume is assume(true), and thus, pointless, and we don't want to do
// anything more here.
// Failure, just remember this instance for future use.
addToLeaderTable(Num, I, I->getParent());
return false;
- } else if (Repl == I) {
+ }
+
+ if (Repl == I) {
// If I was the result of a shortcut PRE, it might already be in the table
// and the best replacement for itself. Nothing to do.
return false;