[llvm] 2f3bc37 - [PredicateInfo] Update comments for PredicateAssume (NFC) (#139269)

via llvm-commits llvm-commits at lists.llvm.org
Sat May 24 13:22:47 PDT 2025


Author: GnSight
Date: 2025-05-24T22:22:43+02:00
New Revision: 2f3bc37cd20bace8ca5aff681369676bff9b1bca

URL: https://github.com/llvm/llvm-project/commit/2f3bc37cd20bace8ca5aff681369676bff9b1bca
DIFF: https://github.com/llvm/llvm-project/commit/2f3bc37cd20bace8ca5aff681369676bff9b1bca.diff

LOG: [PredicateInfo] Update comments for PredicateAssume (NFC) (#139269)

Previously, PredicateAssume was modified to materialize after the assume
statement rather than before it (See 353fa44). Update relevant comments
to match this.

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/PredicateInfo.cpp

Removed: 
    


################################################################################
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<Value *> &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<PredicateAssume>(PossibleCopy)) {
         VD.LocalNum = LN_Middle;
         DomTreeNode *DomNode = DT.getNode(PAssume->AssumeInst->getParent());


        


More information about the llvm-commits mailing list