1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=sccp -S | FileCheck %s
4 @Y = constant [6 x i101] [ i101 12, i101 123456789000000, i101 -12,
5 i101 -123456789000000, i101 0,i101 9123456789000000]
9 ; CHECK-NEXT: ret i101 123456789000000
11 %A = getelementptr [6 x i101], ptr @Y, i32 0, i32 1
12 %B = load i101, ptr %A
15 %E = trunc i101 %DD to i32
16 %F = getelementptr [6 x i101], ptr @Y, i32 0, i32 %E
17 %G = load i101, ptr %F
22 define i101 @large_aggregate() {
23 ; CHECK-LABEL: @large_aggregate(
24 ; CHECK-NEXT: [[D:%.*]] = and i101 undef, 1
25 ; CHECK-NEXT: [[DD:%.*]] = or i101 [[D]], 1
26 ; CHECK-NEXT: [[G:%.*]] = getelementptr i101, ptr getelementptr inbounds ([6 x i101], ptr @Y, i64 0, i64 5), i101 [[DD]]
27 ; CHECK-NEXT: [[L3:%.*]] = load i101, ptr [[G]], align 4
28 ; CHECK-NEXT: ret i101 [[L3]]
30 %B = load i101, ptr undef
33 %F = getelementptr [6 x i101], ptr @Y, i32 0, i32 5
34 %G = getelementptr i101, ptr %F, i101 %DD
35 %L3 = load i101, ptr %G
39 define i101 @large_aggregate_2() {
40 ; CHECK-LABEL: @large_aggregate_2(
41 ; CHECK-NEXT: [[D:%.*]] = and i101 undef, 1
42 ; CHECK-NEXT: [[DD:%.*]] = or i101 [[D]], 1
43 ; CHECK-NEXT: [[G:%.*]] = getelementptr i101, ptr getelementptr inbounds ([6 x i101], ptr @Y, i64 0, i64 5), i101 [[DD]]
44 ; CHECK-NEXT: [[L3:%.*]] = load i101, ptr [[G]], align 4
45 ; CHECK-NEXT: ret i101 [[L3]]
47 %D = and i101 undef, 1
49 %F = getelementptr [6 x i101], ptr @Y, i32 0, i32 5
50 %G = getelementptr i101, ptr %F, i101 %DD
51 %L3 = load i101, ptr %G
55 define void @index_too_large() {
56 ; CHECK-LABEL: @index_too_large(
57 ; CHECK-NEXT: store ptr getelementptr ([6 x i101], ptr @Y, i64 187649984473770, i64 2), ptr undef, align 8
58 ; CHECK-NEXT: ret void
60 %ptr1 = getelementptr [6 x i101], ptr @Y, i32 0, i32 -1
61 %ptr2 = getelementptr i101, ptr %ptr1, i101 9224497936761618431
62 store ptr %ptr2, ptr undef
67 ; https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39197
68 @0 = external dso_local unnamed_addr constant [16 x i8]
69 define void @ossfuzz_39197() {
70 ; CHECK-LABEL: @ossfuzz_39197(
72 ; CHECK-NEXT: ret void
75 %B5 = or i72 0, 2361183241434822606847
76 %i = add nuw nsw i72 %B5, 0
78 %i2 = getelementptr inbounds [4 x [4 x i8]], ptr @0, i72 0, i72 0, i72 %i1