Skip to content

Commit 1087cd2

Browse files
committed
Check value flow in scalarrepl test
1 parent c541236 commit 1087cd2

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

tools/clang/test/DXC/Passes/ScalarReplHLSL/hitobject_make_scalarrepl.ll

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,17 @@ entry:
3434
%tmp = alloca %dx.types.HitObject, align 4
3535
%ray = alloca %struct.RayDesc, align 4
3636
%tmp2 = alloca %dx.types.HitObject, align 4
37+
; CHECK: %[[HIT0:[^ ]+]] = alloca %dx.types.HitObject, align 4
38+
; CHECK: %[[HIT1:[^ ]+]] = alloca %dx.types.HitObject, align 4
39+
; CHECK: %[[HIT2:[^ ]+]] = alloca %dx.types.HitObject, align 4
3740
%0 = bitcast %dx.types.HitObject* %hit to i8*, !dbg !23 ; line:42 col:3
3841
call void @llvm.lifetime.start(i64 4, i8* %0) #0, !dbg !23 ; line:42 col:3
39-
; CHECK: %{{[^ ]+}} = call %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %{{[^ ]+}})
42+
; CHECK: %[[THIS0:[^ ]+]] = call %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %[[HIT0]])
43+
; CHECK-NOT: %[[THIS0]]
4044
%1 = call %dx.types.HitObject* @"dx.hl.op..%dx.types.HitObject* (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %hit), !dbg !27 ; line:42 col:17
4145
%2 = bitcast %dx.types.HitObject* %tmp to i8*, !dbg !28 ; line:43 col:3
4246
call void @llvm.lifetime.start(i64 4, i8* %2) #0, !dbg !28 ; line:43 col:3
43-
; CHECK: call void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %{{[^ ]+}})
47+
; CHECK: call void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %[[HIT1]])
4448
call void @"dx.hl.op..void (i32, %dx.types.HitObject*)"(i32 358, %dx.types.HitObject* %tmp), !dbg !28 ; line:43 col:3
4549
%3 = bitcast %dx.types.HitObject* %tmp to i8*, !dbg !28 ; line:43 col:3
4650
call void @llvm.lifetime.end(i64 4, i8* %3) #0, !dbg !28 ; line:43 col:3
@@ -56,7 +60,11 @@ entry:
5660
store float 1.000000e+03, float* %8, !dbg !30 ; line:44 col:17
5761
%9 = bitcast %dx.types.HitObject* %tmp2 to i8*, !dbg !31 ; line:45 col:3
5862
call void @llvm.lifetime.start(i64 4, i8* %9) #0, !dbg !31 ; line:45 col:3
59-
; CHECK: call void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32, <3 x float>, float, <3 x float>, float)"(i32 387, %dx.types.HitObject* %{{[^ ]+}}, i32 0, i32 1, <3 x float> %{{[^ ]+}}, float %{{[^ ]+}}, <3 x float> %{{[^ ]+}}, float %{{[^ ]+}})
63+
; CHECK: %[[RDO:[^ ]+]] = load <3 x float>
64+
; CHECK: %[[RDTMIN:[^ ]+]] = load float
65+
; CHECK: %[[RDD:[^ ]+]] = load <3 x float>
66+
; CHECK: %[[RDTMAX:[^ ]+]] = load float
67+
; CHECK: call void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32, <3 x float>, float, <3 x float>, float)"(i32 387, %dx.types.HitObject* %[[HIT2]], i32 0, i32 1, <3 x float> %[[RDO]], float %[[RDTMIN]], <3 x float> %[[RDD]], float %[[RDTMAX]])
6068
call void @"dx.hl.op..void (i32, %dx.types.HitObject*, i32, i32, %struct.RayDesc*)"(i32 387, %dx.types.HitObject* %tmp2, i32 0, i32 1, %struct.RayDesc* %ray), !dbg !31 ; line:45 col:3
6169
%10 = bitcast %dx.types.HitObject* %tmp2 to i8*, !dbg !31 ; line:45 col:3
6270
call void @llvm.lifetime.end(i64 4, i8* %10) #0, !dbg !31 ; line:45 col:3

0 commit comments

Comments
 (0)