Skip to content

Commit 58683b6

Browse files
committed
address Justin
1 parent b18f093 commit 58683b6

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

llvm/lib/Target/DirectX/DXILPrepare.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class DXILPrepareModule : public ModulePass {
185185
VersionTuple ValVer = MetadataInfo.ValidatorVersion;
186186
bool SkipValidation = ValVer.getMajor() == 0 && ValVer.getMinor() == 0;
187187

188-
// construct whitelist of valid metadata node kinds
188+
// construct allowlist of valid metadata node kinds
189189
std::array<unsigned, 6> DXILCompatibleMDs = getCompatibleInstructionMDs(M);
190190

191191
for (auto &F : M.functions()) {

llvm/test/CodeGen/DirectX/metadata-stripping.ll

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,25 @@ target triple = "dxilv1.0-unknown-shadermodel6.0-compute"
88
define void @main(i32* %ptr) {
99
entry:
1010
; metadata ID changes to 0 once the current !0 and !1 are removed
11-
; since they aren't in the whitelist. range needs a payload.
11+
; since they aren't in the allowlist. range needs a payload.
1212
; CHECK: %val = load i32, ptr %ptr, align 4, !range [[RANGEMD:![0-9]+]]
1313
%val = load i32, ptr %ptr, align 4, !range !2
1414

1515
%cmp.i = icmp ult i32 1, 2
16+
; Ensure that the !llvm.loop metadata node gets dropped.
17+
; CHECK: br i1 %cmp.i, label %_Z4mainDv3_j.exit, label %_Z4mainDv3_j.exit{{$}}
1618
br i1 %cmp.i, label %_Z4mainDv3_j.exit, label %_Z4mainDv3_j.exit, !llvm.loop !0
1719

1820
_Z4mainDv3_j.exit: ; preds = %for.body.i, %entry
1921
ret void
2022
}
2123

22-
; CHECK: [[RANGEMD]] = !{i32 1, i32 5}
23-
; this next check line checks that nothing comes after the above check line.
24+
; These next check lines check that only the range metadata remains
2425
; No more metadata should be necessary, the rest (the current 0 and 1)
2526
; should be removed.
2627
; CHECK-NOT: !{!"llvm.loop.mustprogress"}
28+
; CHECK: [[RANGEMD]] = !{i32 1, i32 5}
29+
; CHECK-NOT: !{!"llvm.loop.mustprogress"}
2730
!0 = distinct !{!0, !1}
2831
!1 = !{!"llvm.loop.mustprogress"}
2932
!2 = !{i32 1, i32 5}

0 commit comments

Comments
 (0)