[llvm] 0ef61ed - [RISCV] Move NodeExtensionHelper assert to getOrCreateExtendedOp. NFC

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 11 03:03:09 PDT 2024


Author: Luke Lau
Date: 2024-03-11T18:00:29+08:00
New Revision: 0ef61ed54dca2e974928c55b2144b57d4c4ff621

URL: https://github.com/llvm/llvm-project/commit/0ef61ed54dca2e974928c55b2144b57d4c4ff621
DIFF: https://github.com/llvm/llvm-project/commit/0ef61ed54dca2e974928c55b2144b57d4c4ff621.diff

LOG: [RISCV] Move NodeExtensionHelper assert to getOrCreateExtendedOp. NFC

Move the narrow types assert from the ZERO_EXTEND/SIGN_EXTEND case in
fillUpExtensionSupport to getOrCreateExtendedOp so we check the other nodes
too.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
index 71759fdde9af00..08678a859ae2b6 100644
--- a/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
+++ b/llvm/lib/Target/RISCV/RISCVISelLowering.cpp
@@ -13490,6 +13490,7 @@ struct NodeExtensionHelper {
     MVT NarrowVT = getNarrowType(Root, *SupportsExt);
 
     SDValue Source = getSource();
+    assert(Subtarget.getTargetLowering()->isTypeLegal(Source.getValueType()));
     if (Source.getValueType() == NarrowVT)
       return Source;
 
@@ -13657,9 +13658,6 @@ struct NodeExtensionHelper {
       unsigned ScalarBits = VT.getScalarSizeInBits();
       unsigned NarrowScalarBits = NarrowVT.getScalarSizeInBits();
 
-      assert(
-          Subtarget.getTargetLowering()->isTypeLegal(NarrowElt.getValueType()));
-
       // Ensure the extension's semantic is equivalent to rvv vzext or vsext.
       if (ScalarBits != NarrowScalarBits * 2)
         break;


        


More information about the llvm-commits mailing list