Skip to content

Commit 73d4233

Browse files
committed
[InstCombine] Regenerate test checks (NFC)
1 parent 8f4f34f commit 73d4233

File tree

3 files changed

+182
-144
lines changed

3 files changed

+182
-144
lines changed

llvm/test/Transforms/InstCombine/apint-and-xor-merge.ll

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; NOTE: Assertions have been autogenerated by update_test_checks.py
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
22
; This test case checks that the merge of and/xor can work on arbitrary
33
; precision integers.
44

@@ -7,8 +7,8 @@
77
; (x &z ) ^ (y & z) -> (x ^ y) & z
88
define i57 @test1(i57 %x, i57 %y, i57 %z) {
99
; CHECK-LABEL: @test1(
10-
; CHECK-NEXT: [[TMP61:%.*]] = xor i57 %x, %y
11-
; CHECK-NEXT: [[TMP7:%.*]] = and i57 [[TMP61]], %z
10+
; CHECK-NEXT: [[TMP61:%.*]] = xor i57 [[X:%.*]], [[Y:%.*]]
11+
; CHECK-NEXT: [[TMP7:%.*]] = and i57 [[TMP61]], [[Z:%.*]]
1212
; CHECK-NEXT: ret i57 [[TMP7]]
1313
;
1414
%tmp3 = and i57 %z, %x
@@ -20,7 +20,7 @@ define i57 @test1(i57 %x, i57 %y, i57 %z) {
2020
; (x & y) ^ (x | y) -> x ^ y
2121
define i23 @test2(i23 %x, i23 %y, i23 %z) {
2222
; CHECK-LABEL: @test2(
23-
; CHECK-NEXT: [[TMP7:%.*]] = xor i23 %y, %x
23+
; CHECK-NEXT: [[TMP7:%.*]] = xor i23 [[Y:%.*]], [[X:%.*]]
2424
; CHECK-NEXT: ret i23 [[TMP7]]
2525
;
2626
%tmp3 = and i23 %y, %x

llvm/test/Transforms/InstCombine/apint-or.ll

Lines changed: 49 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,64 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
12
; RUN: opt < %s -passes=instcombine -S | FileCheck %s
23

34
; These tests are for Integer BitWidth <= 64 && BitWidth % 2 != 0.
5+
;; A | ~A == -1
46
define i23 @test1(i23 %A) {
5-
;; A | ~A == -1
6-
%NotA = xor i23 -1, %A
7-
%B = or i23 %A, %NotA
8-
ret i23 %B
9-
; CHECK-LABEL: @test1
10-
; CHECK-NEXT: ret i23 -1
7+
; CHECK-LABEL: define i23 @test1(
8+
; CHECK-SAME: i23 [[A:%.*]]) {
9+
; CHECK-NEXT: ret i23 -1
10+
;
11+
%NotA = xor i23 -1, %A
12+
%B = or i23 %A, %NotA
13+
ret i23 %B
1114
}
1215

16+
;; If we have: ((V + N) & C1) | (V & C2)
17+
;; .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0
18+
;; replace with V+N.
1319
define i39 @test2(i39 %V, i39 %M) {
14-
;; If we have: ((V + N) & C1) | (V & C2)
15-
;; .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0
16-
;; replace with V+N.
17-
%C1 = xor i39 274877906943, -1 ;; C2 = 274877906943
18-
%N = and i39 %M, 274877906944
19-
%A = add i39 %V, %N
20-
%B = and i39 %A, %C1
21-
%D = and i39 %V, 274877906943
22-
%R = or i39 %B, %D
23-
ret i39 %R
24-
; CHECK-LABEL: @test2
25-
; CHECK-NEXT: %N = and i39 %M, -274877906944
26-
; CHECK-NEXT: %A = add i39 %N, %V
27-
; CHECK-NEXT: ret i39 %A
20+
; CHECK-LABEL: define i39 @test2(
21+
; CHECK-SAME: i39 [[V:%.*]], i39 [[M:%.*]]) {
22+
; CHECK-NEXT: [[N:%.*]] = and i39 [[M]], -274877906944
23+
; CHECK-NEXT: [[A:%.*]] = add i39 [[N]], [[V]]
24+
; CHECK-NEXT: ret i39 [[A]]
25+
;
26+
%C1 = xor i39 274877906943, -1 ;; C2 = 274877906943
27+
%N = and i39 %M, 274877906944
28+
%A = add i39 %V, %N
29+
%B = and i39 %A, %C1
30+
%D = and i39 %V, 274877906943
31+
%R = or i39 %B, %D
32+
ret i39 %R
2833
}
2934

3035
; These tests are for Integer BitWidth > 64 && BitWidth <= 1024.
36+
;; A | ~A == -1
3137
define i1023 @test4(i1023 %A) {
32-
;; A | ~A == -1
33-
%NotA = xor i1023 -1, %A
34-
%B = or i1023 %A, %NotA
35-
ret i1023 %B
36-
; CHECK-LABEL: @test4
37-
; CHECK-NEXT: ret i1023 -1
38+
; CHECK-LABEL: define i1023 @test4(
39+
; CHECK-SAME: i1023 [[A:%.*]]) {
40+
; CHECK-NEXT: ret i1023 -1
41+
;
42+
%NotA = xor i1023 -1, %A
43+
%B = or i1023 %A, %NotA
44+
ret i1023 %B
3845
}
3946

47+
;; If we have: ((V + N) & C1) | (V & C2)
48+
;; .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0
49+
;; replace with V+N.
4050
define i399 @test5(i399 %V, i399 %M) {
41-
;; If we have: ((V + N) & C1) | (V & C2)
42-
;; .. and C2 = ~C1 and C2 is 0+1+ and (N & C2) == 0
43-
;; replace with V+N.
44-
%C1 = xor i399 274877906943, -1 ;; C2 = 274877906943
45-
%N = and i399 %M, 18446742974197923840
46-
%A = add i399 %V, %N
47-
%B = and i399 %A, %C1
48-
%D = and i399 %V, 274877906943
49-
%R = or i399 %B, %D
50-
ret i399 %R
51-
; CHECK-LABEL: @test5
52-
; CHECK-NEXT: %N = and i399 %M, 18446742974197923840
53-
; CHECK-NEXT: %A = add i399 %N, %V
54-
; CHECK-NEXT: ret i399 %A
51+
; CHECK-LABEL: define i399 @test5(
52+
; CHECK-SAME: i399 [[V:%.*]], i399 [[M:%.*]]) {
53+
; CHECK-NEXT: [[N:%.*]] = and i399 [[M]], 18446742974197923840
54+
; CHECK-NEXT: [[A:%.*]] = add i399 [[N]], [[V]]
55+
; CHECK-NEXT: ret i399 [[A]]
56+
;
57+
%C1 = xor i399 274877906943, -1 ;; C2 = 274877906943
58+
%N = and i399 %M, 18446742974197923840
59+
%A = add i399 %V, %N
60+
%B = and i399 %A, %C1
61+
%D = and i399 %V, 274877906943
62+
%R = or i399 %B, %D
63+
ret i399 %R
5564
}
56-

0 commit comments

Comments
 (0)