[PATCH] D89390: [TargetLowering] Update optimization to check for boolean content

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 14 13:44:57 PDT 2020


spatel added a comment.

Looks like we have a couple of in-tree targets where this will make a difference, so we should add a test.

Try something like this with -mtriple=nvptx ?

  define i32 @pow2_mask_cmp(i32 %x) {
    %a = and i32 %x, 8
    %cmp = icmp ne i32 %a, 0
    %r = zext i1 %cmp to i32
    ret i32 %r
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89390



More information about the llvm-commits mailing list