Skip to content

Commit 6a2ce34

Browse files
committed
[InstCombine] free-inversion.ll - add test coverage for #71390
1 parent 327d627 commit 6a2ce34

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

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

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -740,3 +740,23 @@ exit:
740740
b4:
741741
ret i1 true
742742
}
743+
744+
define i64 @PR71390(i64 %v) {
745+
; CHECK-LABEL: @PR71390(
746+
; CHECK-NEXT: [[AND:%.*]] = and i64 [[V:%.*]], 9187201950435737471
747+
; CHECK-NEXT: [[TMP1:%.*]] = sub nuw i64 -72340172838076674, [[AND]]
748+
; CHECK-NEXT: [[TMP2:%.*]] = add nuw i64 [[AND]], 6872316419617283935
749+
; CHECK-NEXT: [[OR_NOT:%.*]] = and i64 [[TMP1]], [[TMP2]]
750+
; CHECK-NEXT: [[NOT5:%.*]] = or i64 [[V]], [[OR_NOT]]
751+
; CHECK-NEXT: ret i64 [[NOT5]]
752+
;
753+
%and = and i64 %v, 9187201950435737471
754+
%add = add nuw i64 %and, 72340172838076673
755+
%add2 = add nuw i64 %and, 6872316419617283935
756+
%not = xor i64 %v, -1
757+
%not3 = xor i64 %add2, -1
758+
%or = or i64 %add, %not3
759+
%and4 = and i64 %not, %or
760+
%not5 = xor i64 %and4, -1
761+
ret i64 %not5
762+
}

0 commit comments

Comments
 (0)