E->swapOperands(0, 1);
}
- // Perform simplificaiton
+ // Perform simplification.
// TODO: Right now we only check to see if we get a constant result.
// We may get a less than constant, but still better, result for
// some operations.
if (auto *DepSI = dyn_cast<StoreInst>(DepInst)) {
// Can't forward from non-atomic to atomic without violating memory model.
// Also don't need to coerce if they are the same type, we will just
- // propogate..
+ // propagate.
if (LI->isAtomic() > DepSI->isAtomic() ||
LoadType == DepSI->getValueOperand()->getType())
return nullptr;
return nullptr;
int Offset = analyzeLoadFromClobberingLoad(LoadType, LoadPtr, DepLI, DL);
if (Offset >= 0) {
- // We can coerce a constant load into a load
+ // We can coerce a constant load into a load.
if (auto *C = dyn_cast<Constant>(lookupOperandLeader(DepLI)))
if (auto *PossibleConstant =
getConstantLoadValueForLoad(C, Offset, LoadType, DL)) {
auto *Cond = PWC->Condition;
// If this a copy of the condition, it must be either true or false depending
- // on the predicate info type and edge
+ // on the predicate info type and edge.
if (CopyOf == Cond) {
// We should not need to add predicate users because the predicate info is
// already a use of this operand.
Value *FirstOp = lookupOperandLeader(Cmp->getOperand(0));
Value *SecondOp = lookupOperandLeader(Cmp->getOperand(1));
bool SwappedOps = false;
- // Sort the ops
+ // Sort the ops.
if (shouldSwapOperands(FirstOp, SecondOp)) {
std::swap(FirstOp, SecondOp);
SwappedOps = true;
return true;
}
-// Evaluate PHI nodes symbolically, and create an expression result.
+// Evaluate PHI nodes symbolically and create an expression result.
const Expression *NewGVN::performSymbolicPHIEvaluation(Instruction *I) const {
// True if one of the incoming phi edges is a backedge.
bool HasBackedge = false;
OurPredicate = CI->getSwappedPredicate();
}
- // Avoid processing the same info twice
+ // Avoid processing the same info twice.
const PredicateBase *LastPredInfo = nullptr;
// See if we know something about the comparison itself, like it is the target
// of an assume.
// %operands are considered users of the icmp.
// *Currently* we only check one level of comparisons back, and only mark one
- // level back as touched when changes appen . If you modify this code to look
+ // level back as touched when changes happen. If you modify this code to look
// back farther through comparisons, you *must* mark the appropriate
// comparisons as users in PredicateInfo.cpp, or you will cause bugs. See if
// we know something just from the operands themselves