Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit 477bd75

Browse files
committed
[SROA] Clean up a test case a bit prior to adding more testing for
nonnull as part of fixing PR32902. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306353 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent ea254cb commit 477bd75

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

test/Transforms/SROA/preserve-nonnull.ll

+13-15
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,20 @@
33
; Make sure that SROA doesn't lose nonnull metadata
44
; on loads from allocas that get optimized out.
55

6-
; CHECK-LABEL: define float* @yummy_nonnull
7-
; CHECK: [[RETURN:%(.*)]] = load float*, float** %arg, align 8
8-
; CHECK: [[ASSUME:%(.*)]] = icmp ne float* {{.*}}[[RETURN]], null
9-
; CHECK: call void @llvm.assume(i1 {{.*}}[[ASSUME]])
10-
; CHECK: ret float* {{.*}}[[RETURN]]
11-
126
define float* @yummy_nonnull(float** %arg) {
13-
entry-block:
14-
%buf = alloca float*
15-
16-
%_arg_i8 = bitcast float** %arg to i8*
17-
%_buf_i8 = bitcast float** %buf to i8*
18-
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %_buf_i8, i8* %_arg_i8, i64 8, i32 8, i1 false)
19-
20-
%ret = load float*, float** %buf, align 8, !nonnull !0
21-
ret float* %ret
7+
; CHECK-LABEL: define float* @yummy_nonnull(
8+
; CHECK-NEXT: entry:
9+
; CHECK-NEXT: %[[RETURN:.*]] = load float*, float** %arg, align 8
10+
; CHECK-NEXT: %[[ASSUME:.*]] = icmp ne float* %[[RETURN]], null
11+
; CHECK-NEXT: call void @llvm.assume(i1 %[[ASSUME]])
12+
; CHECK-NEXT: ret float* %[[RETURN]]
13+
entry:
14+
%buf = alloca float*
15+
%_arg_i8 = bitcast float** %arg to i8*
16+
%_buf_i8 = bitcast float** %buf to i8*
17+
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %_buf_i8, i8* %_arg_i8, i64 8, i32 8, i1 false)
18+
%ret = load float*, float** %buf, align 8, !nonnull !0
19+
ret float* %ret
2220
}
2321

2422
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1)

0 commit comments

Comments
 (0)