[PATCH] D103077: [DAGCombine] Poison-prove scalarizeExtractedVectorLoad.
Eli Friedman via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu May 27 12:37:32 PDT 2021
efriedma added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:18423
+ KnownBits EltNoBits = DAG.computeKnownBits(EltNo);
+ unsigned NumElts = InVecVT.getVectorElementCount().getKnownMinValue();
+ if (!EltNoBits.getMaxValue().ult(NumElts))
----------------
RKSimon wrote:
> Is there any chance of NumElts not being a pow2 here?
I can't think of anything that would enforce it being a power of two. The usage of getKnownMinValue() here is also wrong: for a scalable vector, we need to clamp the index relative to the actual number of lanes at runtime, not the minimum number of lanes.
TargetLowering::getVectorElementPointer() has all the logic to do this correctly; can we use it here?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103077/new/
https://reviews.llvm.org/D103077
More information about the llvm-commits
mailing list