[PATCH] D146460: [SelectionDAG] Correctly reduce BV to shuffle with zero on big endian

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 24 07:19:16 PDT 2023


nemanjai added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:22011
+      if (DAG.getDataLayout().isBigEndian())
+        ShufMask[i] = (i % ZextRatio == (ZextRatio - 1))
+                          ? Extract.getConstantOperandVal(1)
----------------
RKSimon wrote:
> (very pedantic) Maybe worth pulling out this:
> ```
> unsigned Low = DAG.getDataLayout().isBigEndian() ? (ZextRatio - 1) : 0;
> ShufMask[i] = ((i % ZextRatio) == Low) ? Extract.getConstantOperandVal(1) : NumMaskElts;
> ```
I don't mind getting rid of the tiny `if/else` statements. Thanks. I'll update it.


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