[PATCH] D105016: [TargetLowering][AArch64][SVE] Take into account accessed type when clamping address
    Peter Waller via Phabricator via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Mon Jun 28 06:45:53 PDT 2021
    
    
  
peterwaller-arm added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:7796
     if (auto *IdxCst = dyn_cast<ConstantSDNode>(Idx))
-      if (IdxCst->getZExtValue() < NElts)
+      if (IdxCst->getZExtValue() + NumSubElts <= NElts)
         return Idx;
----------------
Question: Shouldn't this remain `<`? My thinking: Logically, the thing on the left is the maximum index, and when you increment that thing, it needs to remain less than NElts to still be a valid index.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:7819
+  return getVectorSubVecPointer(DAG, VecPtr, VecVT,
+                                VecVT.getVectorElementType(), Index);
+}
----------------
Did you entertain constructing a 1-element vector here and getting rid of the special case?
Repository:
  rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D105016/new/
https://reviews.llvm.org/D105016
    
    
More information about the llvm-commits
mailing list