[PATCH] D145866: [DAG] visitAND - fold (and (any_ext V), c) -> (zero_ext (and (trunc V), c)) if profitable.

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Mar 12 05:25:34 PDT 2023


RKSimon added inline comments.


================
Comment at: llvm/test/CodeGen/X86/switch-phi-const.ll:95
+; CHECK-NEXT:    movzbl %dil, %eax
+; CHECK-NEXT:    leal -1(%rax), %ecx
 ; CHECK-NEXT:    cmpl $54, %ecx
----------------
pengfei wrote:
> This doesn't look efficient than `decl %ecx`.
I agree but we always fold mov+dec to lea: https://simd.godbolt.org/z/vvzfe14oc


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145866



More information about the llvm-commits mailing list