Skip to content
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

ValueTracking: clarify isNotCrossLaneOperation (NFC) #112375

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

artagnon
Copy link
Contributor

Clarify the distinction between lanewise operations, and operations that do not cross vector lanes, with an example, in the header comment.

Clarify the distinction between lanewise operations, and operations that
do not cross vector lanes, with an example, in the header comment.
@llvmbot
Copy link
Member

llvmbot commented Oct 15, 2024

@llvm/pr-subscribers-llvm-analysis

Author: Ramkumar Ramachandra (artagnon)

Changes

Clarify the distinction between lanewise operations, and operations that do not cross vector lanes, with an example, in the header comment.


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

1 Files Affected:

  • (modified) llvm/include/llvm/Analysis/ValueTracking.h (+6-1)
diff --git a/llvm/include/llvm/Analysis/ValueTracking.h b/llvm/include/llvm/Analysis/ValueTracking.h
index 0c6ebf87b29232..2b0377903ac8e3 100644
--- a/llvm/include/llvm/Analysis/ValueTracking.h
+++ b/llvm/include/llvm/Analysis/ValueTracking.h
@@ -791,7 +791,12 @@ bool onlyUsedByLifetimeMarkers(const Value *V);
 /// droppable instructions.
 bool onlyUsedByLifetimeMarkersOrDroppableInsts(const Value *V);
 
-/// Return true if the instruction doesn't potentially cross vector lanes.
+/// Return true if the instruction doesn't potentially cross vector lanes. This
+/// condition is weaker than checking that the instruction is lanewise: lanewise
+/// means that the same operation is splatted across all lanes, but we also
+/// include the case where there is a different operation on each lane, as long
+/// as the operation only uses data from that lane. An example of an operation
+/// that is not lanewise, but doesn't cross vector lanes is insertelement.
 bool isNotCrossLaneOperation(const Instruction *I);
 
 /// Return true if the instruction does not have any effects besides

Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but please also wait on @preames.

@artagnon
Copy link
Contributor Author

artagnon commented Nov 4, 2024

Gentle ping.

Copy link
Collaborator

@preames preames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@artagnon artagnon merged commit 3e8a8fc into llvm:main Nov 4, 2024
10 checks passed
@artagnon artagnon deleted the vt-crosslane-comment branch November 4, 2024 15:54
PhilippRados pushed a commit to PhilippRados/llvm-project that referenced this pull request Nov 6, 2024
Clarify the distinction between lanewise operations, and operations that
do not cross vector lanes, with an example, in the header comment.
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.

4 participants