This DAG combine is correct on little endian targets but is incorrect on big endian targets. Add big endian code to correct it.
Details
Details
- Reviewers
arsenm efriedma RKSimon - Group Reviewers
Restricted Project - Commits
- rGe7c35d71007f: [SelectionDAG] Correctly reduce BV to shuffle with zero on big endian
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
LGTM with one very optional minor
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
22013 | (very pedantic) Maybe worth pulling out this: unsigned Low = DAG.getDataLayout().isBigEndian() ? (ZextRatio - 1) : 0; ShufMask[i] = ((i % ZextRatio) == Low) ? Extract.getConstantOperandVal(1) : NumMaskElts; |
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp | ||
---|---|---|
22013 | I don't mind getting rid of the tiny if/else statements. Thanks. I'll update it. |
(very pedantic) Maybe worth pulling out this: