[PATCH] D142345: [X86] Transform `(icmp eq/ne Abs(A), Pow2)` -> `(and/or (icmp eq/ne A,Pow2), (icmp eq/ne A,-Pow2))`

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 25 13:17:29 PST 2023


goldstein.w.n marked 2 inline comments as done.
goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Target/X86/X86ISelLowering.cpp:53414
+          // We can better optimize this case in DAGCombiner::foldAndOrOfSETCC.
+          if (CInt.isPowerOf2() && !CInt.isZero() && !CInt.isMinSignedValue()) {
+            SDValue BaseOp = LHS.getOperand(0);
----------------
RKSimon wrote:
> APInt::isPowerOf2() shouldn't require a isZero check?
> APInt::isPowerOf2() shouldn't require a isZero check?

Is redundant, updated `D142344` aswell.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142345/new/

https://reviews.llvm.org/D142345



More information about the llvm-commits mailing list