[PATCH] D142090: [InstCombine] precommit tests for D140666

Yingchi Long via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 31 20:50:16 PST 2023


inclyc updated this revision to Diff 493815.
inclyc added a comment.

> But we may need some more negative tests. At least one more for

Add:

  define i1 @masked_not_subset_notoptimized(i32 %A) {
  ; CHECK-LABEL: @masked_not_subset_notoptimized(
  ; CHECK-NEXT:    [[MASK1:%.*]] = and i32 [[A:%.*]], 254
  ; CHECK-NEXT:    [[TST1:%.*]] = icmp ne i32 [[MASK1]], 252
  ; CHECK-NEXT:    [[MASK2:%.*]] = and i32 [[A]], 253
  ; CHECK-NEXT:    [[TST2:%.*]] = icmp ne i32 [[MASK2]], 252
  ; CHECK-NEXT:    [[RES:%.*]] = and i1 [[TST1]], [[TST2]]
  ; CHECK-NEXT:    ret i1 [[RES]]
  ;
    %mask1 = and i32 %A, 254 ; 0xfe
    %tst1 = icmp ne i32 %mask1, 252 ; 0xfc
    %mask2 = and i32 %A, 253 ; 0xfd
    %tst2 = icmp ne i32 %mask2, 252 ; 0xfc
    %res = and i1 %tst1, %tst2
    ret i1 %res
  }



> And we need at least 1 vector test.

I may not understand what you mean :(. We are doing an optimization on scalar right now?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142090

Files:
  llvm/test/Transforms/InstCombine/icmp-logical.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142090.493815.patch
Type: text/x-patch
Size: 3917 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230201/5dca20a7/attachment.bin>


More information about the llvm-commits mailing list