Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[PredicateInfo] Update comments for PredicateAssume #139269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ftyghome
Copy link

@ftyghome ftyghome commented May 9, 2025

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

Previously, PredicateAssume was modified to materialize after the assume
statement rather than before it. Update relevant comments to match this.
Copy link

github-actions bot commented May 9, 2025

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@llvmbot
Copy link
Member

llvmbot commented May 9, 2025

@llvm/pr-subscribers-llvm-transforms

Author: GnSight (ftyghome)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/139269.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Utils/PredicateInfo.cpp (+5-5)
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());

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants