[llvm] [SelectionDAG] Add SDTCisInt<1>/SDTCisFP<1> to SDTVecReduce/SDTFPVecReduce. NFC (PR #162761)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 9 21:09:02 PDT 2025


https://github.com/topperc updated https://github.com/llvm/llvm-project/pull/162761

>From 5cb8df8b1fba2a92822701f738788fa778c14266 Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Thu, 9 Oct 2025 18:41:57 -0700
Subject: [PATCH 1/2] [SelectionDAG] Add SDTCisInt<1>/SDTCisFP<1> to
 SDTVecReduce/SDTFPVecReduce. NFC

---
 llvm/include/llvm/Target/TargetSelectionDAG.td | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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

>From 8794962088bcbfc946a9d909bc019f0f44e7320c Mon Sep 17 00:00:00 2001
From: Craig Topper <craig.topper at sifive.com>
Date: Thu, 9 Oct 2025 21:07:38 -0700
Subject: [PATCH 2/2] fixup! Use SDTCisEltOfVec for SDTFPVecReduce.

---
 llvm/include/llvm/Target/TargetSelectionDAG.td | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/Target/TargetSelectionDAG.td b/llvm/include/llvm/Target/TargetSelectionDAG.td
index 5f4f8c391c489..acb4f07904789 100644
--- a/llvm/include/llvm/Target/TargetSelectionDAG.td
+++ b/llvm/include/llvm/Target/TargetSelectionDAG.td
@@ -303,7 +303,7 @@ def SDTVecReduce : SDTypeProfile<1, 1, [    // vector reduction
   SDTCisInt<0>, SDTCisVec<1>, SDTCisInt<1>
 ]>;
 def SDTFPVecReduce : SDTypeProfile<1, 1, [  // FP vector reduction
-  SDTCisFP<0>, SDTCisVec<1>, SDTCisFP<1>
+  SDTCisFP<0>, SDTCisEltOfVec<0, 1>
 ]>;
 
 def SDTVecReverse : SDTypeProfile<1, 1, [  // vector reverse



More information about the llvm-commits mailing list