[llvm] 914a846 - [RISCV][GISel] Don't custom legalize load/store of vector of pointers if ELEN < XLEN. (#101565)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 15:53:52 PDT 2024


Author: Craig Topper
Date: 2024-08-13T15:53:48-07:00
New Revision: 914a846e2979dc33f41e747b9b8d726424b4d92f

URL: https://github.com/llvm/llvm-project/commit/914a846e2979dc33f41e747b9b8d726424b4d92f
DIFF: https://github.com/llvm/llvm-project/commit/914a846e2979dc33f41e747b9b8d726424b4d92f.diff

LOG: [RISCV][GISel] Don't custom legalize load/store of vector of pointers if ELEN < XLEN. (#101565)

We need to have elements than can hold a pointer sized element.
    
No test because it crashes in LowerLoad or LowerStore now which
needs to be addressed separately.

I also reordered things so all the vector load/store stuff is together.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
index ad36f822accefe..74bfe8b838af77 100644
--- a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
+++ b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp
@@ -330,9 +330,11 @@ RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST)
 
     // we will take the custom lowering logic if we have scalable vector types
     // with non-standard alignments
-    LoadStoreActions.customIf(
-          LegalityPredicates::any(typeIsLegalIntOrFPVec(0, IntOrFPVecTys, ST),
-                                  typeIsLegalPtrVec(0, PtrVecTys, ST)));
+    LoadStoreActions.customIf(typeIsLegalIntOrFPVec(0, IntOrFPVecTys, ST));
+
+    // Pointers require that XLen sized elements are legal.
+    if (XLen <= ST.getELen())
+      LoadStoreActions.customIf(typeIsLegalPtrVec(0, PtrVecTys, ST));
   }
 
   LoadStoreActions.widenScalarToNextPow2(0, /* MinSize = */ 8)


        


More information about the llvm-commits mailing list