Issue 153304
Summary [DirectX] DXILBitcodeWriter fails to write a load of groupshared global array element
Labels bug, backend:DirectX
Assignees
Reporter Icohedron
    The following LLVM IR fails to be written to valid DXIL:

```llvm
@g = local_unnamed_addr addrspace(3) global [10 x i32] zeroinitializer, align 8
define void @CSMain() local_unnamed_addr #0 {
  %gep = getelementptr [10 x i32], ptr addrspace(3) @g, i32 0, i32 1
  %ld = load i32, ptr addrspace(3) %gep, align 2
  ret void
}
attributes #0 = { mustprogress nofree noinline norecurse nosync nounwind willreturn memory(readwrite, argmem: none, inaccessiblemem: none) "approx-func-fp-math"="true" "frame-pointer"="all" "hlsl.numthreads"="4,1,1" "hlsl.shader"="compute" "no-infs-fp-math"="true" "no-nans-fp-math"="true" "no-signed-zeros-fp-math"="true" "no-trapping-math"="true" "stack-protector-buffer-size"="8" }
```

```
> llc -filetype=obj -mtriple=dxil-pc-shadermodel6.7-compute Reproduce.ll -o tmp.dat
> dxv tmp.dat
Load/Store operand is not a pointer type
Validation failed.
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to