File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ // RUN: %clang --driver-mode=dxc -T cs_6_0 -Fo x.dxil %s | FileCheck %s
2
+ // CHECK-NOT: llvm.loop.mustprogress
3
+
4
+ StructuredBuffer<uint4 > X : register (t0);
5
+ StructuredBuffer<float4 > In : register (t1);
6
+ RWStructuredBuffer <float4 > Out : register (u0);
7
+
8
+ [numthreads (1 , 1 , 1 )]
9
+ void main (uint3 dispatch_thread_id : SV_DispatchThreadID ) {
10
+ for (uint I = 0 ; I < X[dispatch_thread_id].x; ++I) {
11
+ Out[dispatch_thread_id] = In[dispatch_thread_id];
12
+ }
13
+ }
Original file line number Diff line number Diff line change @@ -189,6 +189,26 @@ class DXILPrepareModule : public ModulePass {
189
189
for (auto &BB : F) {
190
190
IRBuilder<> Builder (&BB);
191
191
for (auto &I : make_early_inc_range (BB)) {
192
+
193
+ // TODO: Audit this list - is it enough? Too much?
194
+ static unsigned DXILCompatibleMDs[] = {
195
+ LLVMContext::MD_dbg,
196
+ LLVMContext::MD_tbaa,
197
+ LLVMContext::MD_prof,
198
+ LLVMContext::MD_fpmath,
199
+ LLVMContext::MD_range,
200
+ LLVMContext::MD_tbaa_struct,
201
+ LLVMContext::MD_invariant_load,
202
+ LLVMContext::MD_alias_scope,
203
+ LLVMContext::MD_noalias,
204
+ LLVMContext::MD_nontemporal,
205
+ LLVMContext::MD_mem_parallel_loop_access,
206
+ LLVMContext::MD_nonnull,
207
+ LLVMContext::MD_dereferenceable,
208
+ LLVMContext::MD_dereferenceable_or_null,
209
+ };
210
+ I.dropUnknownNonDebugMetadata (DXILCompatibleMDs);
211
+
192
212
if (I.getOpcode () == Instruction::FNeg) {
193
213
Builder.SetInsertPoint (&I);
194
214
Value *In = I.getOperand (0 );
You can’t perform that action at this time.
0 commit comments