[PATCH] D141607: [RISCV] Optimize (brcond (seteq (and X, (1 << C)-1), 0))
Craig Topper via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 12 11:02:42 PST 2023
craig.topper added inline comments.
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:1547
+ if ((isPowerOf2_64(Mask) ||
+ (isShiftedMask_64(Mask) && TrailingZeros == 0)) &&
+ !isInt<12>(Mask)) {
----------------
is `isShiftedMask_64(Mask) && TrailingZeros == 0` the same as `isMask_64(Mask)`
================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:1554
+ } else
+ ShAmt = Subtarget.getXLen() - (64 - countLeadingZeros(Mask));
+
----------------
I think you can use LHS.getValueSizeInBits() instead of Subtarget.getXLen().
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D141607/new/
https://reviews.llvm.org/D141607
More information about the llvm-commits
mailing list