[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
Fri Jan 27 11:43:37 PST 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/test/CodeGen/X86/icmp-pow2-logic-npow2.ll:11-30
 define i1 @eq_pow_or(i32 %0) nounwind {
 ; X86-LABEL: eq_pow_or:
 ; X86:       # %bb.0:
 ; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
 ; X86-NEXT:    addl $32, %eax
 ; X86-NEXT:    testl $-65, %eax
 ; X86-NEXT:    sete %al
----------------
pengfei wrote:
> So we may remove these tests instead? We should avoid to add dud tests.
> So we may remove these tests instead? We should avoid to add dud tests.

This test is for `D142344` where it is not a dud.
Do you mean `abs_eq_pow2_zero` and `abs_ne_pow2_signed_min`?


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