Skip to content

Commit 69bd66b

Browse files
committed
[Tests] Remove some and/or constant expressions in tests (NFC)
In preparation for their removal in D158081.
1 parent 7ed4b7e commit 69bd66b

25 files changed

+98
-47
lines changed

llvm/test/Analysis/ValueTracking/func-ptr-lsb.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ entry:
99
; Even though the address of @foo is aligned, we cannot assume that the
1010
; pointer has the same alignment. This is not true for e.g. ARM targets
1111
; which store ARM/Thumb state in the LSB
12-
ret i32 and (i32 ptrtoint (ptr @foo to i32), i32 -4)
12+
%and = and i32 ptrtoint (ptr @foo to i32), -4
13+
ret i32 %and
1314
}
1415

1516
define internal void @foo() align 16 {

llvm/test/Assembler/2009-03-24-ZextConstantExpr.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
@gdtr = external global [0 x i8]
55

66
define void @test() {
7-
call zeroext i1 @paging_map(i64 zext (i32 and (i32 ptrtoint (ptr @gdtr to i32), i32 -4096) to i64))
7+
call zeroext i1 @paging_map(i64 zext (i32 add (i32 ptrtoint (ptr @gdtr to i32), i32 -4096) to i64))
88
ret void
99
}
1010

llvm/test/CodeGen/ARM/2007-04-03-UndefinedSymbol.ll

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ entry:
2727
%b.i1 = alloca %struct.B, align 4
2828
%b.i = alloca %struct.B, align 4
2929
store i32 4, ptr %b.i
30-
br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit, label %cond_true.i
30+
%and1 = and i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), 4294967296
31+
%cmp1 = icmp eq i64 %and1, 0
32+
br i1 %cmp1, label %_Z3fooiM1BFvvE.exit, label %cond_true.i
3133

3234
cond_true.i:
3335
%ctg23.i = getelementptr i8, ptr %b.i, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)
@@ -41,7 +43,9 @@ _Z3fooiM1BFvvE.exit:
4143
%ctg25.i = getelementptr i8, ptr %b.i, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)
4244
call void %iftmp.2.0.i(ptr %ctg25.i)
4345
store i32 6, ptr %b.i29
44-
br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (ptr @_ZN1B1jEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit56, label %cond_true.i46
46+
%and2 = and i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), 4294967296
47+
%cmp2 = icmp eq i64 %and2, 0
48+
br i1 %cmp2, label %_Z3fooiM1BFvvE.exit56, label %cond_true.i46
4549

4650
cond_true.i46:
4751
%ctg23.i36 = getelementptr i8, ptr %b.i29, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1jEv to i32) to i64), i64 32) to i32), i32 1)
@@ -55,7 +59,9 @@ _Z3fooiM1BFvvE.exit56:
5559
%ctg25.i54 = getelementptr i8, ptr %b.i29, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1jEv to i32) to i64), i64 32) to i32), i32 1)
5660
call void %iftmp.2.0.i49(ptr %ctg25.i54)
5761
store i32 -1, ptr %b.i1
58-
br i1 icmp eq (i64 and (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 4294967296), i64 0), label %_Z3fooiM1BFvvE.exit28, label %cond_true.i18
62+
%and3 = and i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), 4294967296
63+
%cmp3 = icmp eq i64 %and3, 0
64+
br i1 %cmp3, label %_Z3fooiM1BFvvE.exit28, label %cond_true.i18
5965

6066
cond_true.i18:
6167
%ctg23.i8 = getelementptr i8, ptr %b.i1, i32 ashr (i32 trunc (i64 lshr (i64 zext (i32 ptrtoint (ptr @_ZN1B1iEv to i32) to i64), i64 32) to i32), i32 1)

llvm/test/CodeGen/ARM/2012-01-23-PostRA-LICM.ll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ bb4: ; preds = %bb3
2222
%tmp6 = and <4 x i32> %tmp5, <i32 8388607, i32 8388607, i32 8388607, i32 8388607>
2323
%tmp7 = or <4 x i32> %tmp6, <i32 1065353216, i32 1065353216, i32 1065353216, i32 1065353216>
2424
%tmp8 = bitcast <4 x i32> %tmp7 to <4 x float>
25-
%tmp9 = fsub <4 x float> %tmp8, bitcast (i128 or (i128 shl (i128 zext (i64 trunc (i128 lshr (i128 bitcast (<4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> to i128), i128 64) to i64) to i128), i128 64), i128 zext (i64 trunc (i128 bitcast (<4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> to i128) to i64) to i128)) to <4 x float>)
25+
%or = or i128 shl (i128 zext (i64 trunc (i128 lshr (i128 bitcast (<4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> to i128), i128 64) to i64) to i128), i128 64), zext (i64 trunc (i128 bitcast (<4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> to i128) to i64) to i128)
26+
%bc = bitcast i128 %or to <4 x float>
27+
%tmp9 = fsub <4 x float> %tmp8, %bc
2628
%tmp10 = fmul <4 x float> undef, %tmp9
2729
%tmp11 = fadd <4 x float> undef, %tmp10
2830
%tmp12 = bitcast <4 x float> zeroinitializer to i128
@@ -47,7 +49,9 @@ bb4: ; preds = %bb3
4749
%tmp30 = and <4 x i32> %tmp29, <i32 8388607, i32 8388607, i32 8388607, i32 8388607>
4850
%tmp31 = or <4 x i32> %tmp30, <i32 1065353216, i32 1065353216, i32 1065353216, i32 1065353216>
4951
%tmp32 = bitcast <4 x i32> %tmp31 to <4 x float>
50-
%tmp33 = fsub <4 x float> %tmp32, bitcast (i128 or (i128 shl (i128 zext (i64 trunc (i128 lshr (i128 bitcast (<4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> to i128), i128 64) to i64) to i128), i128 64), i128 zext (i64 trunc (i128 bitcast (<4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> to i128) to i64) to i128)) to <4 x float>)
52+
%or2 = or i128 shl (i128 zext (i64 trunc (i128 lshr (i128 bitcast (<4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> to i128), i128 64) to i64) to i128), i128 64), zext (i64 trunc (i128 bitcast (<4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 1.000000e+00> to i128) to i64) to i128)
53+
%bc2 = bitcast i128 %or2 to <4 x float>
54+
%tmp33 = fsub <4 x float> %tmp32, %bc2
5155
%tmp34 = call <4 x float> @llvm.arm.neon.vrecps.v4f32(<4 x float> undef, <4 x float> %tmp28) nounwind
5256
%tmp35 = fmul <4 x float> %tmp34, undef
5357
%tmp36 = fmul <4 x float> %tmp35, undef

llvm/test/CodeGen/ARM/load-address-masked.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ target triple = "armv4t-unknown-linux-gnueabi"
77

88
define i32 @foo() {
99
entry:
10-
ret i32 and (i32 ptrtoint (ptr @a to i32), i32 255)
10+
%and = and i32 ptrtoint (ptr @a to i32), 255
11+
ret i32 %and
1112
}
1213

1314
; CHECK-LABEL: foo:

llvm/test/CodeGen/Hexagon/packetize-l2fetch.ll

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ target triple = "hexagon"
1616
; Function Attrs: nounwind
1717
define void @f0() local_unnamed_addr #0 {
1818
b0:
19-
store ptr inttoptr (i32 and (i32 sext (i8 ptrtoint (ptr getelementptr inbounds ([32768 x i8], ptr @g0, i32 0, i32 10000) to i8) to i32), i32 -65536) to ptr), ptr getelementptr inbounds ([15 x ptr], ptr @g1, i32 0, i32 1), align 4
20-
store ptr inttoptr (i32 and (i32 sext (i8 ptrtoint (ptr getelementptr inbounds ([32768 x i8], ptr @g0, i32 0, i32 10000) to i8) to i32), i32 -65536) to ptr), ptr getelementptr inbounds ([15 x ptr], ptr @g1, i32 0, i32 6), align 8
19+
%and = and i32 sext (i8 ptrtoint (ptr getelementptr inbounds ([32768 x i8], ptr @g0, i32 0, i32 10000) to i8) to i32), -65536
20+
%ptr = inttoptr i32 %and to ptr
21+
store ptr %ptr, ptr getelementptr inbounds ([15 x ptr], ptr @g1, i32 0, i32 1), align 4
22+
store ptr %ptr, ptr getelementptr inbounds ([15 x ptr], ptr @g1, i32 0, i32 6), align 8
2123
tail call void @f1()
2224
%v0 = load ptr, ptr @g1, align 8
2325
tail call void @llvm.hexagon.Y5.l2fetch(ptr %v0, i64 -9223372036854775808)

llvm/test/CodeGen/Mips/pr42736.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ entry:
2020
; STATIC-NEXT: sd $[[R0]]
2121

2222
%val = alloca i64, align 8
23-
store i64 and (i64 ptrtoint (ptr @foo to i64), i64 268435455), ptr %val, align 8
23+
%and = and i64 ptrtoint (ptr @foo to i64), 268435455
24+
store i64 %and, ptr %val, align 8
2425
%0 = load i64, ptr %val, align 8
2526
ret void
2627
}

llvm/test/CodeGen/X86/2007-04-24-VectorCrash.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ declare <4 x float> @llvm.x86.sse.add.ss(<4 x float>, <4 x float>)
66

77
define void @test(ptr %P) {
88
entry:
9-
or <4 x i32> zeroinitializer, and (<4 x i32> bitcast (<4 x float> shufflevector (<4 x float> undef, <4 x float> undef, <4 x i32> zeroinitializer) to <4 x i32>), <4 x i32> < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 >) ; <<4 x i32>>:0 [#uses=1]
9+
%and = and <4 x i32> bitcast (<4 x float> shufflevector (<4 x float> undef, <4 x float> undef, <4 x i32> zeroinitializer) to <4 x i32>), < i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648 >
10+
or <4 x i32> zeroinitializer, %and
1011
bitcast <4 x i32> %0 to <4 x float> ; <<4 x float>>:1 [#uses=1]
1112
fsub <4 x float> %1, zeroinitializer ; <<4 x float>>:2 [#uses=1]
1213
fsub <4 x float> shufflevector (<4 x float> undef, <4 x float> undef, <4 x i32> zeroinitializer), %2 ; <<4 x float>>:3 [#uses=1]

llvm/test/CodeGen/X86/2012-03-20-LargeConstantExpr.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ target triple = "x86_64-apple-macosx10.8.0"
77
; CHECK-NEXT: .quad 4575657222473777152
88
; CHECK-NEXT: .quad 4575657222473777152
99

10-
@.memset_pattern = internal unnamed_addr constant i128 or (i128 zext (i64 bitcast (<2 x float> <float 1.000000e+00, float 1.000000e+00> to i64) to i128), i128 shl (i128 zext (i64 bitcast (<2 x float> <float 1.000000e+00, float 1.000000e+00> to i64) to i128), i128 64)), align 16
10+
@.memset_pattern = internal unnamed_addr constant i128 add (i128 zext (i64 bitcast (<2 x float> <float 1.000000e+00, float 1.000000e+00> to i64) to i128), i128 shl (i128 zext (i64 bitcast (<2 x float> <float 1.000000e+00, float 1.000000e+00> to i64) to i128), i128 64)), align 16
1111

1212
define void @foo(ptr %a, i64 %b) {
1313
call void @memset_pattern16(ptr %a, ptr @.memset_pattern, i64 %b)

llvm/test/CodeGen/X86/address-type-promotion-constantexpr.ll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@
1010
; CHECK: xor %eax, %eax
1111
define i32 @main() {
1212
entry:
13-
%foo = load i8, ptr getelementptr ([2 x i8], ptr @b, i64 0, i64 sext (i8 or (i8 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @c, i64 0, i64 1), ptr @a) to i8), i8 1) to i64)), align 1
13+
%or = or i8 zext (i1 icmp eq (ptr getelementptr inbounds ([2 x i32], ptr @c, i64 0, i64 1), ptr @a) to i8), 1
14+
%sext = sext i8 %or to i64
15+
%gep = getelementptr [2 x i8], ptr @b, i64 0, i64 %sext
16+
%foo = load i8, ptr %gep, align 1
1417
ret i32 0
1518
}
1619

llvm/test/CodeGen/X86/br-fold.ll

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
; X64_DARWIN-NEXT: ud2
99

1010
; X64_LINUX: orq _ZN11xercesc_2_56XMLUni16fgNotationStringE@GOTPCREL(%rip), %rax
11-
; X64_LINUX-NEXT: jne
12-
; X64_LINUX-NEXT: %bb8.i329
11+
; X64_LINUX-NEXT: je
12+
; X64_LINUX-NEXT: %bb4.i.i318.preheader
1313

1414
; X64_WINDOWS: orq %rax, %rcx
15-
; X64_WINDOWS-NEXT: jne
15+
; X64_WINDOWS-NEXT: je
1616

1717
; X64_WINDOWS_GNU: movq .refptr._ZN11xercesc_2_513SchemaSymbols21fgURI_SCHEMAFORSCHEMAE(%rip), %rax
1818
; X64_WINDOWS_GNU: orq .refptr._ZN11xercesc_2_56XMLUni16fgNotationStringE(%rip), %rax
19-
; X64_WINDOWS_GNU-NEXT: jne
19+
; X64_WINDOWS_GNU-NEXT: je
2020

2121
; PS4: orq _ZN11xercesc_2_56XMLUni16fgNotationStringE@GOTPCREL(%rip), %rax
2222
; PS4-NEXT: ud2
@@ -26,9 +26,9 @@
2626

2727
define fastcc void @foo() {
2828
entry:
29-
br i1 icmp eq (i64 or (i64 ptrtoint (ptr @_ZN11xercesc_2_513SchemaSymbols21fgURI_SCHEMAFORSCHEMAE to i64),
30-
i64 ptrtoint (ptr @_ZN11xercesc_2_56XMLUni16fgNotationStringE to i64)), i64 0),
31-
label %bb8.i329, label %bb4.i.i318.preheader
29+
%or = or i64 ptrtoint (ptr @_ZN11xercesc_2_513SchemaSymbols21fgURI_SCHEMAFORSCHEMAE to i64), ptrtoint (ptr @_ZN11xercesc_2_56XMLUni16fgNotationStringE to i64)
30+
%cmp = icmp eq i64 %or, 0
31+
br i1 %cmp, label %bb8.i329, label %bb4.i.i318.preheader
3232

3333
bb4.i.i318.preheader: ; preds = %bb6
3434
unreachable

llvm/test/CodeGen/X86/pre-coalesce-2.ll

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,10 @@ cleanup: ; preds = %while.body
182182
br i1 %62, label %63, label %66
183183

184184
; <label>:63: ; preds = %cleanup
185-
%64 = icmp sge i8 trunc (i64 add (i64 and (i64 ptrtoint (ptr @b to i64), i64 7), i64 3) to i8), %61
185+
%and = and i64 ptrtoint (ptr @b to i64), 7
186+
%add = add i64 %and, 3
187+
%trunc = trunc i64 %add to i8
188+
%64 = icmp sge i8 %trunc, %61
186189
br i1 %64, label %65, label %66
187190

188191
; <label>:65: ; preds = %63

llvm/test/CodeGen/X86/tailcall-returndup-void.ll

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ c263:
1313
br i1 %ln268, label %c26a, label %n26p
1414

1515
n26p: ; preds = %c263
16-
br i1 icmp ne (i64 and (i64 ptrtoint (ptr @sES_closure to i64), i64 7), i64 0), label %c1ZP.i, label %n1ZQ.i
16+
%and = and i64 ptrtoint (ptr @sES_closure to i64), 7
17+
%cmp = icmp ne i64 %and, 0
18+
br i1 %cmp, label %c1ZP.i, label %n1ZQ.i
1719

1820
n1ZQ.i: ; preds = %n26p
1921
%ln1ZT.i = load i64, ptr @sES_closure, align 8

llvm/test/CodeGen/X86/x86-64-tls-1.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ define i64 @z() nounwind {
55
; CHECK-NEXT: addl %fs:0, %e[[R0]]x
66
; CHECK-NEXT: andl $100, %e[[R0]]x
77

8-
ret i64 and (i64 ptrtoint (ptr @tm_nest_level to i64), i64 100)
8+
%and = and i64 ptrtoint (ptr @tm_nest_level to i64), 100
9+
ret i64 %and
910
}

llvm/test/DebugInfo/MIR/X86/kill-after-spill.mir

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
%6 = load i32, i32* %variableLocal11, align 8
5858
%variableLocal2 = getelementptr inbounds %struct.firstStruct, %struct.firstStruct* %5, i64 0, i32 1
5959
%7 = load i8, i8* %variableLocal2, align 4
60-
tail call void @func3(i32 %6, i8 zeroext %7, i8 zeroext 5, i8* inttoptr (i64 or (i64 ptrtoint ([7 x i8]* @.str to i64), i64 -92238) to i8*), i32 %variable2)
60+
%or = or i64 ptrtoint ([7 x i8]* @.str to i64), -92238
61+
%ptr = inttoptr i64 %or to i8*
62+
tail call void @func3(i32 %6, i8 zeroext %7, i8 zeroext 5, i8* %ptr, i32 %variable2)
6163
br label %cleanup
6264

6365
private.exit: ; preds = %if.end

llvm/test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ define i1 @lt_signed_to_large_unsigned(i8 %SB) {
3030

3131
define i1 @PR28011(i16 %a) {
3232
; CHECK-LABEL: @PR28011(
33-
; CHECK-NEXT: [[CONV:%.*]] = sext i16 [[A:%.*]] to i32
34-
; CHECK-NEXT: [[CMP:%.*]] = icmp ne i32 [[CONV]], or (i32 zext (i1 icmp ne (ptr @b, ptr @a) to i32), i32 1)
33+
; CHECK-NEXT: [[CMP:%.*]] = icmp ne i16 [[A:%.*]], 1
3534
; CHECK-NEXT: ret i1 [[CMP]]
3635
;
3736
%conv = sext i16 %a to i32
38-
%cmp = icmp ne i32 %conv, or (i32 zext (i1 icmp ne (ptr @b, ptr @a) to i32), i32 1)
37+
%or = or i32 zext (i1 icmp ne (ptr @b, ptr @a) to i32), 1
38+
%cmp = icmp ne i32 %conv, %or
3939
ret i1 %cmp
4040
}
4141

llvm/test/Transforms/InstCombine/2012-3-15-or-xor-constant.ll

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

45
@g = extern_weak global i32
56
define i32 @function(i32 %x) nounwind {
7+
; CHECK-LABEL: define i32 @function
8+
; CHECK-SAME: (i32 [[X:%.*]]) #[[ATTR0:[0-9]+]] {
9+
; CHECK-NEXT: entry:
10+
; CHECK-NEXT: [[XOR:%.*]] = xor i32 [[X]], 1
11+
; CHECK-NEXT: store volatile i32 [[XOR]], ptr inttoptr (i64 1 to ptr), align 4
12+
; CHECK-NEXT: [[OR4:%.*]] = or i32 [[X]], 1
13+
; CHECK-NEXT: ret i32 [[OR4]]
14+
;
615
entry:
716
%xor = xor i32 %x, 1
817
store volatile i32 %xor, ptr inttoptr (i64 1 to ptr), align 4
9-
%or4 = or i32 or (i32 zext (i1 icmp eq (ptr @g, ptr null) to i32), i32 1), %xor
18+
%or = or i32 zext (i1 icmp eq (ptr @g, ptr null) to i32), 1
19+
%or4 = or i32 %or, %xor
1020
ret i32 %or4
1121
}
12-
; CHECK-LABEL: define i32 @function(

llvm/test/Transforms/InstCombine/constant-expr-datalayout.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ define void @test1(ptr %ptr) {
1111
; CHECK-NEXT: store i64 0, ptr [[PTR:%.*]], align 8
1212
; CHECK-NEXT: ret void
1313
;
14-
store i64 and (i64 ptrtoint (ptr getelementptr (%test1.struct, ptr @test1.aligned_glbl, i32 0, i32 1) to i64), i64 3), ptr %ptr
14+
%and = and i64 ptrtoint (ptr getelementptr (%test1.struct, ptr @test1.aligned_glbl, i32 0, i32 1) to i64), 3
15+
store i64 %and, ptr %ptr
1516
ret void
1617
}
1718

llvm/test/Transforms/InstCombine/gepgep.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ target triple = "x86_64-unknown-linux-gnu"
88
declare void @use(ptr)
99

1010
define void @f() {
11-
call void @use(ptr getelementptr (i8, ptr getelementptr (i8, ptr @buffer, i64 and (i64 sub (i64 0, i64 ptrtoint (ptr @buffer to i64)), i64 63)), i64 64))
11+
call void @use(ptr getelementptr (i8, ptr getelementptr (i8, ptr @buffer, i64 add (i64 sub (i64 0, i64 ptrtoint (ptr @buffer to i64)), i64 63)), i64 64))
1212
ret void
1313
}

llvm/test/Transforms/InstCombine/icmp-mul.ll

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -797,12 +797,13 @@ define <2 x i1> @eq_mul_constants_with_tz_splat(<2 x i32> %x, <2 x i32> %y) {
797797

798798
define i1 @oss_fuzz_39934(i32 %arg) {
799799
; CHECK-LABEL: @oss_fuzz_39934(
800-
; CHECK-NEXT: [[B13:%.*]] = mul nsw i32 [[ARG:%.*]], -65536
801-
; CHECK-NEXT: [[C10:%.*]] = icmp ne i32 [[B13]], mul (i32 or (i32 zext (i1 icmp eq (ptr @g, ptr null) to i32), i32 65537), i32 -65536)
800+
; CHECK-NEXT: [[C10:%.*]] = icmp ne i32 [[ARG:%.*]], 1
802801
; CHECK-NEXT: ret i1 [[C10]]
803802
;
804803
%B13 = mul nsw i32 %arg, -65536
805-
%C10 = icmp ne i32 mul (i32 or (i32 zext (i1 icmp eq (ptr @g, ptr null) to i32), i32 65537), i32 -65536), %B13
804+
%or = or i32 zext (i1 icmp eq (ptr @g, ptr null) to i32), 65537
805+
%mul = mul i32 %or, -65536
806+
%C10 = icmp ne i32 %mul, %B13
806807
ret i1 %C10
807808
}
808809

llvm/test/Transforms/InstCombine/not-add.ll

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ define void @pr50370(i32 %x) {
175175
;
176176
entry:
177177
%xor = xor i32 %x, 1
178-
%or4 = or i32 or (i32 zext (i1 icmp eq (ptr @g, ptr null) to i32), i32 1), 65536
178+
%or = or i32 zext (i1 icmp eq (ptr @g, ptr null) to i32), 1
179+
%or4 = or i32 %or, 65536
179180
%B6 = ashr i32 65536, %or4
180181
%B15 = srem i32 %B6, %xor
181182
%B20 = sdiv i32 %or4, 2147483647

llvm/test/Transforms/LICM/pr23608.ll

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@ define void @fn1() {
4141
; USE_ASSUME-NEXT: br label [[INDIRECTGOTO:%.*]]
4242
; USE_ASSUME: while.cond:
4343
; USE_ASSUME-NEXT: [[TMP:%.*]] = load ptr, ptr @a, align 8
44-
; USE_ASSUME-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr inttoptr (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665) to ptr), i64 8), "nonnull"(ptr inttoptr (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665) to ptr)), "align"(ptr inttoptr (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665) to ptr), i64 8) ]
45-
; USE_ASSUME-NEXT: call void @llvm.assume(i1 true) [ "dereferenceable"(ptr inttoptr (i64 add (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665), i64 35184372088832) to ptr), i64 4), "nonnull"(ptr inttoptr (i64 add (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665), i64 35184372088832) to ptr)), "align"(ptr inttoptr (i64 add (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665), i64 35184372088832) to ptr), i64 8) ]
4644
; USE_ASSUME-NEXT: br label [[BB2:%.*]]
4745
; USE_ASSUME: bb:
4846
; USE_ASSUME-NEXT: call void @__msan_warning_noreturn()
@@ -69,8 +67,12 @@ entry:
6967

7068
while.cond: ; preds = %indirectgoto, %bb15
7169
%tmp = load ptr, ptr @a, align 8
72-
%_msld = load i64, ptr inttoptr (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665) to ptr), align 8
73-
%tmp1 = load i32, ptr inttoptr (i64 add (i64 and (i64 ptrtoint (ptr @a to i64), i64 -70368744177665), i64 35184372088832) to ptr), align 8
70+
%and = and i64 ptrtoint (ptr @a to i64), -70368744177665
71+
%itop = inttoptr i64 %and to ptr
72+
%_msld = load i64, ptr %itop, align 8
73+
%add = add i64 %and, 35184372088832
74+
%itop2 = inttoptr i64 %add to ptr
75+
%tmp1 = load i32, ptr %itop2, align 8
7476
br label %bb2
7577

7678
bb: ; preds = %while.cond

llvm/test/Transforms/LoopIdiom/basic.ll

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,7 +1594,9 @@ define noalias ptr @_ZN8CMSPULog9beginImplEja(ptr nocapture writeonly %0) local_
15941594
; CHECK-NEXT: [[TMP4]] = add nuw nsw i32 [[TMP3]], 1
15951595
; CHECK-NEXT: [[TMP5:%.*]] = zext i32 [[TMP3]] to i64
15961596
; CHECK-NEXT: [[TMP6:%.*]] = getelementptr [[CLASS_CMSPULOG:%.*]], ptr [[TMP0:%.*]], i64 0, i32 8, i64 [[TMP5]]
1597-
; CHECK-NEXT: store i32 trunc (i64 and (i64 ptrtoint (ptr @G to i64), i64 16777215) to i32), ptr [[TMP6]], align 4
1597+
; CHECK-NEXT: [[AND:%.*]] = and i64 ptrtoint (ptr @G to i64), 16777215
1598+
; CHECK-NEXT: [[TRUNC:%.*]] = trunc i64 [[AND]] to i32
1599+
; CHECK-NEXT: store i32 [[TRUNC]], ptr [[TMP6]], align 4
15981600
; CHECK-NEXT: [[TMP7:%.*]] = icmp ult i32 [[TMP3]], 511
15991601
; CHECK-NEXT: br i1 [[TMP7]], label [[TMP2]], label [[TMP8:%.*]]
16001602
; CHECK: 8:
@@ -1607,7 +1609,9 @@ define noalias ptr @_ZN8CMSPULog9beginImplEja(ptr nocapture writeonly %0) local_
16071609
%4 = add nuw nsw i32 %3, 1
16081610
%5 = zext i32 %3 to i64
16091611
%6 = getelementptr %class.CMSPULog, ptr %0, i64 0, i32 8, i64 %5
1610-
store i32 trunc (i64 and (i64 ptrtoint (ptr @G to i64), i64 16777215) to i32), ptr %6, align 4
1612+
%and = and i64 ptrtoint (ptr @G to i64), 16777215
1613+
%trunc = trunc i64 %and to i32
1614+
store i32 %trunc, ptr %6, align 4
16111615
%7 = icmp ult i32 %3, 511
16121616
br i1 %7, label %2, label %8
16131617

0 commit comments

Comments
 (0)