11; RUN: opt -S --dxil-prepare %s | FileCheck %s
22
3- ; This test tests the whitelist inside of DxilPrepare.cpp.
4- ; It ensures that certain metadata nodes are removed that aren't
5- ; in the whitelist, and that certain nodes may remain that
6- ; are on the whitelist.
3+ ; Test that only metadata nodes that are valid in DXIL are allowed through
74
85target triple = "dxilv1.0-unknown-shadermodel6.0-compute"
96
@@ -12,24 +9,17 @@ define void @main(i32* %ptr) {
129entry:
1310 ; metadata ID changes to 0 once the current !0 and !1 are removed
1411 ; since they aren't in the whitelist. range needs a payload.
15- ; CHECK: %val = load i32, ptr %ptr, align 4, !range !0
12+ ; CHECK: %val = load i32, ptr %ptr, align 4, !range [[RANGEMD:![0-9]+]]
1613 %val = load i32 , ptr %ptr , align 4 , !range !2
1714
18- ; dx.nonuniform is a valid metadata node kind on the whitelist,
19- ; so give it a bogus payload and ensure it sticks around
20- ; CHECK-next: %cmp.i1.not = icmp eq i32 1, 0, !dx.nonuniform !0
21- %cmp.i1.not = icmp eq i32 1 , 0 , !dx.nonuniform !2
22- br i1 %cmp.i1.not , label %_Z4mainDv3_j.exit , label %for.body.i
23-
24- for.body.i: ; preds = %entry
2515 %cmp.i = icmp ult i32 1 , 2
26- br i1 %cmp.i , label %for.body.i , label %_Z4mainDv3_j.exit , !llvm.loop !0
16+ br i1 %cmp.i , label %_Z4mainDv3_j.exit , label %_Z4mainDv3_j.exit , !llvm.loop !0
2717
2818_Z4mainDv3_j.exit: ; preds = %for.body.i, %entry
2919 ret void
3020}
3121
32- ; CHECK: !0 = !{i32 1, i32 5}
22+ ; CHECK: [[RANGEMD]] = !{i32 1, i32 5}
3323; this next check line checks that nothing comes after the above check line.
3424; No more metadata should be necessary, the rest (the current 0 and 1)
3525; should be removed.
0 commit comments