diff --git a/llvm/lib/Transforms/Utils/PredicateInfo.cpp b/llvm/lib/Transforms/Utils/PredicateInfo.cpp index 9ae10b07147fc..d4b2bcf40fd8a 100644 --- a/llvm/lib/Transforms/Utils/PredicateInfo.cpp +++ b/llvm/lib/Transforms/Utils/PredicateInfo.cpp @@ -546,10 +546,10 @@ Value *PredicateInfoBuilder::materializeStack(unsigned int &Counter, ? OrigOp : (RenameStack.end() - Start - 1)->Def; // For edge predicates, we can just place the operand in the block before - // the terminator. For assume, we have to place it right before the assume - // to ensure we dominate all of our uses. Always insert right before the - // relevant instruction (terminator, assume), so that we insert in proper - // order in the case of multiple predicateinfo in the same block. + // the terminator. For assume, we have to place it right after the assume + // to ensure we dominate all uses except assume itself. Always insert + // right before the terminator or after the assume, so that we insert in + // proper order in the case of multiple predicateinfo in the same block. // The number of named values is used to detect if a new declaration was // added. If so, that declaration is tracked so that it can be removed when // the analysis is done. The corner case were a new declaration results in @@ -622,7 +622,7 @@ void PredicateInfoBuilder::renameUses(SmallVectorImpl &OpsToRename) { // The predicate info for branches always come first, they will get // materialized in the split block at the top of the block. // The predicate info for assumes will be somewhere in the middle, - // it will get materialized in front of the assume. + // it will get materialized right after the assume. if (const auto *PAssume = dyn_cast(PossibleCopy)) { VD.LocalNum = LN_Middle; DomTreeNode *DomNode = DT.getNode(PAssume->AssumeInst->getParent());