Skip to content

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.
@artagnon artagnon requested review from nikic and preames October 15, 2024 15:08
@llvmbot llvmbot added the llvm:analysis Includes value tracking, cost tables and constant folding label Oct 15, 2024
@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
@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

Labels

llvm:analysis Includes value tracking, cost tables and constant folding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants