@@ -0,0 +1,53 @@
+; RUN: opt -S -dxil-op-lower %s | FileCheck %s
+
+target triple = "dxil-pc-shadermodel6.0-compute"
+
+declare i32 @some_val();
+
+define void @test_buffers() {
+ ; RWBuffer Buf : register(u5, space3)
+ %typed0 = call target("dx.TypedBuffer", <4 x float>, 1, 0,
https://github.com/dmpots edited
https://github.com/llvm/llvm-project/pull/104251
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dmpots approved this pull request.
Overall, LGTM!
https://github.com/llvm/llvm-project/pull/104251
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-co
@@ -0,0 +1,58 @@
+; RUN: opt -S -dxil-op-lower %s | FileCheck %s
+
+target triple = "dxil-pc-shadermodel6.6-compute"
+
+declare i32 @some_val();
+
+define void @test_bindings() {
+ ; RWBuffer Buf : register(u5, space3)
+ %typed0 = call target("dx.TypedBuffer", <4 x float>, 1, 0,
@@ -119,6 +123,142 @@ class OpLowerer {
});
}
+ /// Create a cast between a `target("dx")` type and `dx.types.Handle`, which
+ /// is intended to be removed by the end of lowering. This is used to allow
+ /// lowering of ops which need to change their return or argume
@@ -119,6 +123,119 @@ class OpLowerer {
});
}
+ Value *createTmpHandleCast(Value *V, Type *Ty) {
+Function *CastFn = Intrinsic::getDeclaration(&M, Intrinsic::dx_cast_handle,
+ {Ty, V->getType()});
+CallInst *Cast =
@@ -119,6 +123,119 @@ class OpLowerer {
});
}
+ Value *createTmpHandleCast(Value *V, Type *Ty) {
+Function *CastFn = Intrinsic::getDeclaration(&M, Intrinsic::dx_cast_handle,
+ {Ty, V->getType()});
+CallInst *Cast =
@@ -0,0 +1,61 @@
+; RUN: opt -S -dxil-op-lower %s | FileCheck %s
dmpots wrote:
I don't see tests for either
1. Unbounded resource arrays
2. Non-constant index into resource arrays
I think it would be good to have tests for these.
https://github.com/llvm/llvm-p
@@ -119,6 +123,119 @@ class OpLowerer {
});
}
+ Value *createTmpHandleCast(Value *V, Type *Ty) {
+Function *CastFn = Intrinsic::getDeclaration(&M, Intrinsic::dx_cast_handle,
+ {Ty, V->getType()});
+CallInst *Cast =
@@ -683,6 +685,14 @@ def Dot4 : DXILOp<56, dot4> {
let attributes = [Attributes];
}
+def CreateHandle : DXILOp<57, createHandle> {
+ let Doc = "creates the handle to a resource";
+ // ResourceClass, RangeID, Index, NonUniform
+ let arguments = [Int8Ty, Int32Ty, Int32Ty,
@@ -119,6 +123,119 @@ class OpLowerer {
});
}
+ Value *createTmpHandleCast(Value *V, Type *Ty) {
+Function *CastFn = Intrinsic::getDeclaration(&M, Intrinsic::dx_cast_handle,
+ {Ty, V->getType()});
+CallInst *Cast =
@@ -0,0 +1,102 @@
+; RUN: opt -S -dxil-op-lower %s | FileCheck %s
+
+target triple = "dxil-pc-shadermodel6.6-compute"
+
+declare void @scalar_user(float)
+declare void @vector_user(<4 x float>)
+
+define void @loadfloats() {
+ ; CHECK: [[BIND:%.*]] = call %dx.types.Handle @dx.op.
@@ -236,6 +236,59 @@ class OpLowerer {
lowerToBindAndAnnotateHandle(F);
}
+ void lowerTypedBufferLoad(Function &F) {
+IRBuilder<> &IRB = OpBuilder.getIRB();
+Type *Int32Ty = IRB.getInt32Ty();
+
+replaceFunction(F, [&](CallInst *CI) -> Error {
+ IRB.Se
@@ -0,0 +1,102 @@
+; RUN: opt -S -dxil-op-lower %s | FileCheck %s
+
+target triple = "dxil-pc-shadermodel6.6-compute"
+
+declare void @scalar_user(float)
+declare void @vector_user(<4 x float>)
+
+define void @loadfloats() {
+ ; CHECK: [[BIND:%.*]] = call %dx.types.Handle @dx.op.
@@ -0,0 +1,102 @@
+; RUN: opt -S -dxil-op-lower %s | FileCheck %s
+
+target triple = "dxil-pc-shadermodel6.6-compute"
+
+declare void @scalar_user(float)
+declare void @vector_user(<4 x float>)
+
+define void @loadfloats() {
+ ; CHECK: [[BIND:%.*]] = call %dx.types.Handle @dx.op.
@@ -0,0 +1,102 @@
+; RUN: opt -S -dxil-op-lower %s | FileCheck %s
+
+target triple = "dxil-pc-shadermodel6.6-compute"
+
+declare void @scalar_user(float)
+declare void @vector_user(<4 x float>)
+
+define void @loadfloats() {
+ ; CHECK: [[BIND:%.*]] = call %dx.types.Handle @dx.op.
@@ -683,6 +686,17 @@ def CreateHandle : DXILOp<57, createHandle> {
let stages = [Stages];
}
+def BufferLoad : DXILOp<68, bufferLoad> {
+ let Doc = "reads from a TypedBuffer";
+ // Handle, Coord0, Coord1
+ let arguments = [HandleTy, Int32Ty, Int32Ty];
+ let result = Overl
https://github.com/dmpots edited
https://github.com/llvm/llvm-project/pull/104252
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dmpots approved this pull request.
Overall, LGTM
https://github.com/llvm/llvm-project/pull/104252
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-com
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -emit-llvm
-disable-llvm-passes -o - %s | FileCheck %s
dmpots wrote:
I think this is fine for testing this change, but ROVs are not allowed to be
used in CS (only PS).
This sha
https://github.com/dmpots edited https://github.com/llvm/llvm-project/pull/74897
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dmpots approved this pull request.
With a description and comment in the test it otherwise LGTM.
https://github.com/llvm/llvm-project/pull/74897
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.ll
dmpots wrote:
This PR seems to be missing a description.
https://github.com/llvm/llvm-project/pull/74897
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
https://github.com/dmpots approved this pull request.
https://github.com/llvm/llvm-project/pull/73967
___
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
24 matches
Mail list logo