Skip to content

Conversation

topperc
Copy link
Collaborator

@topperc topperc commented Oct 10, 2025

No description provided.

@topperc topperc requested a review from s-barannikov October 10, 2025 01:55
@llvmbot llvmbot added the llvm:SelectionDAG SelectionDAGISel as well label Oct 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Oct 10, 2025

@llvm/pr-subscribers-llvm-selectiondag

Author: Craig Topper (topperc)

Changes

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

1 Files Affected:

  • (modified) llvm/include/llvm/Target/TargetSelectionDAG.td (+2-2)
diff --git a/llvm/include/llvm/Target/TargetSelectionDAG.td b/llvm/include/llvm/Target/TargetSelectionDAG.td
index 7bc90d4428800..5f4f8c391c489 100644
--- a/llvm/include/llvm/Target/TargetSelectionDAG.td
+++ b/llvm/include/llvm/Target/TargetSelectionDAG.td
@@ -300,10 +300,10 @@ def SDTVecInsert : SDTypeProfile<1, 3, [    // vector insert
   SDTCisEltOfVec<2, 1>, SDTCisSameAs<0, 1>, SDTCisPtrTy<3>
 ]>;
 def SDTVecReduce : SDTypeProfile<1, 1, [    // vector reduction
-  SDTCisInt<0>, SDTCisVec<1>
+  SDTCisInt<0>, SDTCisVec<1>, SDTCisInt<1>
 ]>;
 def SDTFPVecReduce : SDTypeProfile<1, 1, [  // FP vector reduction
-  SDTCisFP<0>, SDTCisVec<1>
+  SDTCisFP<0>, SDTCisVec<1>, SDTCisFP<1>
 ]>;
 
 def SDTVecReverse : SDTypeProfile<1, 1, [  // vector reverse

Copy link
Contributor

@s-barannikov s-barannikov left a comment

Choose a reason for hiding this comment

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

LGTM

]>;
def SDTFPVecReduce : SDTypeProfile<1, 1, [ // FP vector reduction
SDTCisFP<0>, SDTCisVec<1>
SDTCisFP<0>, SDTCisVec<1>, SDTCisFP<1>
Copy link
Contributor

Choose a reason for hiding this comment

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


Can this be:

Suggested change
SDTCisFP<0>, SDTCisVec<1>, SDTCisFP<1>
SDTCisEltOfVec<0, 1>, SDTCisVec<1>, SDTCisFP<1>

Corresponding LLVM intrinsics require the result type to match the source element type, but I don't know if this is still a requirement in SDAG.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It might be a requirement in SelectionDAG for FP but not int.

@topperc topperc changed the title [SelectionDAG] Add SDTCisInt<1>/SDTCisFP<1> to SDTVecReduce/SDTFPVecReduce. NFC [SelectionDAG] Add SDTCisInt<1> to SDTVecReduce and SDTCisEltOfVec to SDTFPVecReduce. NFC Oct 10, 2025
@topperc topperc merged commit c265d7a into llvm:main Oct 10, 2025
10 checks passed
@topperc topperc deleted the pr/sdt-reduce branch October 10, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:SelectionDAG SelectionDAGISel as well

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants