Skip to content

Commit 7007919

Browse files
committed
[InstCombine] Add additional test for invert of lshr (NFC)
1 parent 852f6be commit 7007919

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

llvm/test/Transforms/InstCombine/free-inversion.ll

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,3 +524,15 @@ define i8 @lshr_not_nneg(i8 %x, i8 %y) {
524524
%shr.not = xor i8 %shr, -1
525525
ret i8 %shr.not
526526
}
527+
528+
define i8 @lshr_not_nneg2(i8 %x) {
529+
; CHECK-LABEL: @lshr_not_nneg2(
530+
; CHECK-NEXT: [[SHR:%.*]] = lshr i8 [[X:%.*]], 1
531+
; CHECK-NEXT: [[SHR_NOT1:%.*]] = or i8 [[SHR]], -128
532+
; CHECK-NEXT: ret i8 [[SHR_NOT1]]
533+
;
534+
%x.not = xor i8 %x, -1
535+
%shr = lshr i8 %x.not, 1
536+
%shr.not = xor i8 %shr, -1
537+
ret i8 %shr.not
538+
}

0 commit comments

Comments
 (0)