[llvm-branch-commits] [llvm] 02930b8 - [NVPTX] Promote v2i8 to v2i16 (#111189)

Artem Belevich via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 25 00:32:07 PST 2024


Author: Manasij Mukherjee
Date: 2024-11-19T14:15:13-08:00
New Revision: 02930b87faeb490505b22f588757a18744248b6f

URL: https://github.com/llvm/llvm-project/commit/02930b87faeb490505b22f588757a18744248b6f
DIFF: https://github.com/llvm/llvm-project/commit/02930b87faeb490505b22f588757a18744248b6f.diff

LOG: [NVPTX] Promote v2i8 to v2i16 (#111189)

Promote v2i8 to v2i16, fixes a crash.
Re-enable a test in NVPTX/vector-returns.ll

Partial cherry-pick of fda2fea w/o the test which does not exist in release/19.x
https://github.com/llvm/llvm-project/issues/104864

Added: 
    

Modified: 
    llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
index 6975412ce5d35b..b2153a7afe7365 100644
--- a/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
+++ b/llvm/lib/Target/NVPTX/NVPTXISelLowering.cpp
@@ -229,6 +229,10 @@ static void ComputePTXValueVTs(const TargetLowering &TLI, const DataLayout &DL,
         // v*i8 are formally lowered as v4i8
         EltVT = MVT::v4i8;
         NumElts = (NumElts + 3) / 4;
+      } else if (EltVT.getSimpleVT() == MVT::i8 && NumElts == 2) {
+        // v2i8 is promoted to v2i16
+        NumElts = 1;
+        EltVT = MVT::v2i16;
       }
       for (unsigned j = 0; j != NumElts; ++j) {
         ValueVTs.push_back(EltVT);


        


More information about the llvm-branch-commits mailing list