Skip to content

[DirectX] DXILBitcodeWriter writes malformed loads for groupshared arrays #153304

@Icohedron

Description

@Icohedron

The following LLVM IR fails to be written to valid DXIL:

@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.

In the BitcodeReader of dxv, the pointer operand of the load apparently is of the type %dxilOpaquePtrReservedName = type opaque

This is preventing 120 DML shaders from successfully validating.

Metadata

Metadata

Assignees

Labels

backend:DirectXbugIndicates an unexpected problem or unintended behavior

Type

Projects

Status

Active

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions