forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DXIL][Analysis] Make sure resource accessors are contiguous
When some resource types were present, but not all of them, we were ending up in a situation where we would fail to initialize the `FirstX` variables and get incorrect iterators. Fixes llvm#128560.
- Loading branch information
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
; Regression test for https://github.com/llvm/llvm-project/issues/128560 - | ||
; check that cbuffers are populated correctly when there aren't any other kinds | ||
; of resource. | ||
|
||
; RUN: opt -S -passes=dxil-translate-metadata %s | FileCheck %s | ||
|
||
target triple = "dxil-pc-shadermodel6.6-compute" | ||
|
||
define void @cbuffer_is_only_binding() { | ||
%cbuf = call target("dx.CBuffer", target("dx.Layout", {float}, 4, 0)) | ||
@llvm.dx.resource.handlefrombinding(i32 1, i32 8, i32 1, i32 0, i1 false) | ||
; CHECK: %cbuffer = type | ||
|
||
ret void | ||
} | ||
|
||
; CHECK: @[[CB0:.*]] = external constant %cbuffer | ||
|
||
; CHECK: !{i32 0, ptr @[[CB0]], !"" |