[PATCH] D111248: [SelectionDAG] Widen scalable-vector stores via VP_STORE
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 7 11:08:31 PDT 2021
craig.topper added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:5022
+ // Generate a vector-predicated store if it is custom/legal on the target.
+ // To avoid possible recusion, only do this if the widened mask type is
+ // legal.
----------------
recusion -> recursion?
================
Comment at: llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp:5037
+ EVT WideVT = TLI.getTypeToTransformTo(*DAG.getContext(), StVT);
+ EVT WideMaskVT = WideVT.changeVectorElementType(MVT::i1);
+ if (WideVT.isScalableVector() &&
----------------
I'm distrusting of changeVectorElementType. If WideVT happens to be an MVT, the changed type must also be an MVT since there is no way to get the LLVMContext from the MVT to make an EVT for the i1 vector.
Can we use EVT::getVectorVT here instead?
================
Comment at: llvm/test/CodeGen/RISCV/rvv/load-store-sdnode.ll:40
+; CHECK: # %bb.0:
+; CHECK-NEXT: vsetvli a1, zero, e8, mf2, ta, mu
+; CHECK-NEXT: vle8.v v8, (a0)
----------------
How are we able to widen this load? Looks like we inferred an align of 4. I think we used that alignment to infer that it was ok to widen using the logic we have for fixed vectors. But I don't think that can work with vscale.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D111248/new/
https://reviews.llvm.org/D111248
More information about the llvm-commits
mailing list