[PATCH] D146460: [SelectionDAG] Correctly reduce BV to shuffle with zero on big endian
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Mar 21 03:09:32 PDT 2023
RKSimon accepted this revision.
RKSimon added a comment.
This revision is now accepted and ready to land.
LGTM with one very optional minor
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22011
+ if (DAG.getDataLayout().isBigEndian())
+ ShufMask[i] = (i % ZextRatio == (ZextRatio - 1))
+ ? Extract.getConstantOperandVal(1)
----------------
(very pedantic) Maybe worth pulling out this:
```
unsigned Low = DAG.getDataLayout().isBigEndian() ? (ZextRatio - 1) : 0;
ShufMask[i] = ((i % ZextRatio) == Low) ? Extract.getConstantOperandVal(1) : NumMaskElts;
```
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D146460/new/
https://reviews.llvm.org/D146460
More information about the llvm-commits
mailing list