[PATCH] D87930: [DAG] Add BuildVectorSDNode::getRepeatedSequence helper to recognise multi-element splat patterns
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 21 06:22:04 PDT 2020
RKSimon added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:9830-9831
+ for (unsigned I = 0; I != NumOps; ++I) {
+ if (!DemandedElts[I])
+ continue;
+ SDValue &SeqOp = Sequence[I % SeqLen];
----------------
yubing wrote:
> If we have a BV = [0,1,2,3,0,1,2,3], DemandedElts is 0b11011101, Shouldn't we return a Sequence = [0,undef,2,3]? But it seems if !DemandedElts[I], we will never set SeqOp, so the Sequence[1] will be SDValue().
We can't create undefs on the fly without access to the SelectionDAG (this method is inside BuildVectorSDNode). If we're not demanding this element at all then it should be safe just to use a null SDValue()
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87930/new/
https://reviews.llvm.org/D87930
More information about the llvm-commits
mailing list