[clang] [llvm] [DXIL] Remove incompatible metadata types when preparing DXIL. (PR #136386)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 25 13:19:31 PDT 2025
================
@@ -0,0 +1,80 @@
+; RUN: opt -S --dxil-prepare %s | FileCheck %s
+
+source_filename = "C:\\Users\\jbatista\\Desktop\\particle_life.hlsl"
+target datalayout = "e-m:e-p:32:32-i1:32-i8:8-i16:16-i32:32-i64:64-f16:16-f32:32-f64:64-n8:16:32:64"
+target triple = "dxilv1.0-unknown-shadermodel6.0-compute"
+
+%StructuredBuffer = type { <4 x i32> }
+%StructuredBuffer.1 = type { <4 x float> }
+%RWStructuredBuffer = type { <4 x float> }
+%dx.types.Handle = type { ptr }
+%dx.types.ResRet.i32 = type { i32, i32, i32, i32, i32 }
+%dx.types.ResRet.f32 = type { float, float, float, float, i32 }
+
+ at 0 = external constant %StructuredBuffer
+ at 1 = external constant %StructuredBuffer.1
+ at 2 = external constant %RWStructuredBuffer
+
+; Function Attrs: noinline nounwind memory(readwrite, inaccessiblemem: none)
+define void @main() local_unnamed_addr #0 {
+entry:
+ %cmp.i1.not = icmp eq i32 1, 0
+ br i1 %cmp.i1.not, label %_Z4mainDv3_j.exit, label %for.body.i
+
+for.body.i: ; preds = %entry
+ %cmp.i = icmp ult i32 1, 2
+ br i1 %cmp.i, label %for.body.i, label %_Z4mainDv3_j.exit, !llvm.loop !16
----------------
bogner wrote:
It would be good to check that this `br` instruction is present, but doesn't have the `llvm.loop` metadata
https://github.com/llvm/llvm-project/pull/136386
More information about the cfe-commits
mailing list