Skip to content

Commit 4bcea68

Browse files
committed
[InstCombine] Test avoid to create bitreverse.i1 (NFC)
1 parent 3aeffcf commit 4bcea68

File tree

1 file changed

+12
-0
lines changed
  • llvm/test/Transforms/InstCombine

1 file changed

+12
-0
lines changed

llvm/test/Transforms/InstCombine/or.ll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2035,3 +2035,15 @@ define i32 @or_xor_and_commuted3(i32 %x, i32 %y, i32 %z) {
20352035
%or1 = or i32 %xor, %yy
20362036
ret i32 %or1
20372037
}
2038+
2039+
define i1 @or_truncs(i8 %x) {
2040+
; CHECK-LABEL: @or_truncs(
2041+
; CHECK-NEXT: [[TRUNC:%.*]] = trunc i8 [[X:%.*]] to i1
2042+
; CHECK-NEXT: [[OR1:%.*]] = call i1 @llvm.bitreverse.i1(i1 [[TRUNC]])
2043+
; CHECK-NEXT: ret i1 [[OR1]]
2044+
;
2045+
%trunc1 = trunc i8 %x to i1
2046+
%trunc2 = trunc i8 %x to i1
2047+
%or1 = or i1 %trunc1, %trunc2
2048+
ret i1 %or1
2049+
}

0 commit comments

Comments
 (0)