https://github.com/pow2clk updated
https://github.com/llvm/llvm-project/pull/104656
>From 9aff63478b76f042c05b7ae3dd1a2c099dc615de Mon Sep 17 00:00:00 2001
From: Greg Roth
Date: Fri, 2 Aug 2024 20:10:04 -0600
Subject: [PATCH 1/7] Add SPIRV generation for HLSL dot
This adds the SPIRV fdot, sdot
https://github.com/pow2clk updated
https://github.com/llvm/llvm-project/pull/104656
>From 9aff63478b76f042c05b7ae3dd1a2c099dc615de Mon Sep 17 00:00:00 2001
From: Greg Roth
Date: Fri, 2 Aug 2024 20:10:04 -0600
Subject: [PATCH 1/7] Add SPIRV generation for HLSL dot
This adds the SPIRV fdot, sdot
@@ -363,9 +382,13 @@ static bool expandIntrinsic(Function &F, CallInst *Orig) {
case Intrinsic::dx_normalize:
Result = expandNormalizeIntrinsic(Orig);
break;
+ case Intrinsic::dx_fdot:
+Result =
+expandFloatDotIntrinsic(Orig, Orig->getOperand(0),
Orig->g
@@ -1446,6 +1452,90 @@ bool SPIRVInstructionSelector::selectRsqrt(Register
ResVReg,
.constrainAllUses(TII, TRI, RBI);
}
+// Select the OpDot instruction for the given float dot
+bool SPIRVInstructionSelector::selectFloatDot(Register ResVReg,
+
https://github.com/pow2clk closed
https://github.com/llvm/llvm-project/pull/104656
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,161 +1,172 @@
// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
-// RUN: --check-prefixes=CHECK,NATIVE_HALF
+// RUN: --check-pr
https://github.com/pow2clk created
https://github.com/llvm/llvm-project/pull/105907
Previously, functions named "main" got the NoRecurse attribute consistent with
the behavior of C++, which HLSL largely follows. However, standard recursion is
not allowed in HLSL, so all functions should really
https://github.com/pow2clk created
https://github.com/llvm/llvm-project/pull/106096
Thread init guards are generated for local static variables when using the
Microsoft CXX ABI. This ABI is also used for HLSL generation, but DXIL doesn't
need the corresponding _Init_thread_header/footer calls
https://github.com/pow2clk commented:
Thanks @AmrDeveloper ! Really appreciate your initiative to take this on!
I think it might be helpful to use this excellent documentation resource
https://github.com/llvm/llvm-project/blob/main/llvm/docs/CommandGuide/FileCheck.rst#filecheck-string-substitut
@@ -15,70 +15,70 @@
// DXIL_NATIVE_HALF: define noundef half @
// SPIR_NATIVE_HALF: define spir_func noundef half @
-// DXIL_NATIVE_HALF: %hlsl.frac = call half @llvm.dx.frac.f16(
-// SPIR_NATIVE_HALF: %hlsl.frac = call half @llvm.spv.frac.f16(
+// DXIL_NATIVE_HALF: %hlsl.frac
@@ -25,7 +25,7 @@ void main(unsigned GI : SV_GroupIndex) {}
//CHECK-NEXT: entry:
//CHECK-NEXT: call void @"?call_me_first@@YAXXZ"()
//CHECK-NEXT: call void @"?then_call_me@@YAXXZ"()
-//CHECK-NEXT: %0 = call i32 @llvm.dx.flattened.thread.id.in.group()
+//CHECK-NEXT: %0 =
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/105930
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pow2clk updated
https://github.com/llvm/llvm-project/pull/106588
>From 12253818bd47aa8c324f6222586965f356b11c90 Mon Sep 17 00:00:00 2001
From: Greg Roth
Date: Wed, 24 Jul 2024 16:49:19 -0600
Subject: [PATCH 01/12] [HLSL] set alwaysinline on HLSL functions
HLSL inlines all it
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/108662
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pow2clk approved this pull request.
I'm not objecting to anything, but I made a few comments out of interest
https://github.com/llvm/llvm-project/pull/108662
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.
@@ -12,7 +12,7 @@
// HALF: #define __HLSL_ENABLE_16_BIT 1
// NOHALF-NOT: __HLSL_ENABLE_16_BIT
-// CHECK: #define __HLSL_VERSION 2021
+// CHECK: #define __HLSL_VERSION 2028
pow2clk wrote:
2028 == 202x and 2029 == 202y I expect?
https://github.com/llvm/llvm-p
@@ -37,7 +37,7 @@ _Static_assert(is_same<__decltype(4294967296),
int64_t>::value, "4294967296 is i
// Clang emits a warning that it is interpreting it as unsigned because that is
// not conforming to the C standard.
-// expected-warning@+1{{integer literal is too large to be
@@ -1,35 +1,66 @@
-// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
-// RUN: dxil-pc-shadermodel6.3-library %s \
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.3-library %s \
// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s
https://github.com/pow2clk commented:
Just a few comments to explain the changes that aren't just mangling style
changes.
https://github.com/llvm/llvm-project/pull/111632
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/c
@@ -1,93 +1,96 @@
-// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
-// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
-// RUN: --check-prefixes=CHECK,NATIVE_HALF
-// RUN:
@@ -1,7 +1,7 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -std=hlsl202x
-emit-llvm -disable-llvm-passes %s -o - | FileCheck %s
--check-prefixes=CS,NOINLINE,CHECK
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -std=hlsl202x
-emit-llvm -disable-llvm-p
@@ -56,14 +55,12 @@ void main() {
// CHECK-LABEL: define {{.*}}DoSilly
// CHECK-NEXT:entry:
-// CHECK-NEXT: [[ResPtr:%.*]] = alloca ptr
// CHECK-NEXT: [[ThisPtrAddr:%.*]] = alloca ptr
-// CHECK-NEXT: store ptr [[AggRes:%.*]], ptr [[ResPtr]]
// CHECK-NEXT: store ptr {{.*}
@@ -289,17 +289,19 @@ void setFour(inout int I) {
// CHECK: [[B:%.*]] = alloca %struct.B
// CHECK: [[Tmp:%.*]] = alloca i32
-// CHECK: [[BFLoad:%.*]] = load i32, ptr [[B]]
-// CHECK: [[BFshl:%.*]] = shl i32 [[BFLoad]], 24
-// CHECK: [[BFashr:%.*]] = ashr i32 [[BFshl]], 24
-//
@@ -13,16 +13,16 @@ void InitBuf(RWBuffer buf) {
}
// CHECK-NOT: _Init_thread_epoch
-// CHECK: define internal void @"?main@@YAXXZ"
+// CHECK: define internal void @_Z4mainv
// CHECK-NEXT: entry:
// CHECK-NEXT: [[Tmp1:%.*]] = alloca %"class.hlsl::RWBuffer"
-// CHECK-NEXT: [[
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111632
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111632
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111632
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111632
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -260,10 +260,10 @@ void order_matters(inout int X, inout int Y) {
// CHECK: store i32 [[VVal]], ptr [[Tmp0]]
// CHECK: [[VVal:%.*]] = load i32, ptr [[V]]
// CHECK: store i32 [[VVal]], ptr [[Tmp1]]
-// CHECK: call void {{.*}}order_matters{{.*}}(ptr noalias noundef nonnull
al
@@ -1,93 +1,96 @@
-// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -x hlsl -triple \
-// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
-// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
-// RUN: --check-prefixes=CHECK,NATIVE_HALF
-// RUN:
@@ -0,0 +1,222 @@
+; RUN: opt -S -dxil-finalize-linkage
-mtriple=dxil-unknown-shadermodel6.5-compute %s | FileCheck %s
+; RUN: llc %s --filetype=asm -o - | FileCheck %s
pow2clk wrote:
Yes, and this test expects them to. The exported functions start at line 137
@@ -0,0 +1,64 @@
+// RUN: %clang_cc1 -finclude-default-header -x hlsl -triple \
+// RUN: dxil-pc-shadermodel6.3-library %s -fnative-half-type \
+// RUN: -emit-llvm -disable-llvm-passes -o - | FileCheck %s \
+// RUN: --check-prefixes=CHECK,NATIVE_HALF \
+// RUN: -DFNATTRS=n
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,26 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only
-disable-llvm-passes -verify -verify-ignore-unexpected
pow2clk wrote:
I'll copy my comment from elsewhere here:
Are you
@@ -0,0 +1,68 @@
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv-unknown-unknown %s -o - |
FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv-unknown-unknown %s -o -
-filetype=obj | spirv-val %}
+
+; CHECK-DAG: %[[#op_ext_glsl:]] = OpExtInstImport "GLSL.std.450"
@@ -0,0 +1,54 @@
+; RUN: opt -S -dxil-intrinsic-expansion -scalarizer -dxil-op-lower
-mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
+
+; Make sure dxil op function calls for degrees are expanded and lowered as
fmul for float and half.
+
+define noundef half @degrees_h
https://github.com/pow2clk commented:
None of my suggestions are essential, but I'll give you a chance to consider
them even if you reject them all before I approve.
https://github.com/llvm/llvm-project/pull/111209
___
cfe-commits mailing list
cfe-com
@@ -0,0 +1,54 @@
+; RUN: opt -S -dxil-intrinsic-expansion -scalarizer -dxil-op-lower
-mtriple=dxil-pc-shadermodel6.3-library %s | FileCheck %s
+
+; Make sure dxil op function calls for degrees are expanded and lowered as
fmul for float and half.
+
+define noundef half @degrees_h
@@ -0,0 +1,50 @@
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o -
| FileCheck %s
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o -
| FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pow2clk commented:
Small typo in description:
"IntrinscsDirectX"
Looks good, but I have a question about the SPIRV part.
https://github.com/llvm/llvm-project/pull/111576
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111576
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -18827,9 +18827,21 @@ case Builtin::BI__builtin_hlsl_elementwise_isinf: {
ArrayRef{Op0, Op1}, nullptr, "hlsl.step");
}
case Builtin::BI__builtin_hlsl_wave_get_lane_index: {
-return EmitRuntimeCall(CGM.CreateRuntimeFunction(
-llvm::FunctionType::get(In
@@ -0,0 +1,6 @@
+// RUN: %clang_cc1 -finclude-default-header -triple
dxil-pc-shadermodel6.6-library %s -fnative-half-type -emit-llvm-only
-disable-llvm-passes -verify -verify-ignore-unexpected
pow2clk wrote:
Are you getting unexpected diagnostics? If so, I'd li
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111209
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,50 @@
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv64-unknown-unknown %s -o -
| FileCheck %s
+; RUN: llc -verify-machineinstrs -O0 -mtriple=spirv32-unknown-unknown %s -o -
| FileCheck %s
+; RUN: %if spirv-tools %{ llc -O0 -mtriple=spirv64-unknown-unknown %s -o
https://github.com/pow2clk commented:
I'm a bit out of my depth here, but I've been trying to understand Itanium
mangling better and I think my suggestion to coalesce the vendor mangled
portions is valid at least.
https://github.com/llvm/llvm-project/pull/110327
___
@@ -4493,28 +4493,34 @@ void CXXNameMangler::mangleType(const
ArrayParameterType *T) {
}
void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) {
- mangleType(T->getWrappedType());
+ llvm::SmallString<64> Str("_Res");
const HLSLAttributedResourceType::Attri
@@ -4493,28 +4493,34 @@ void CXXNameMangler::mangleType(const
ArrayParameterType *T) {
}
void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) {
- mangleType(T->getWrappedType());
+ llvm::SmallString<64> Str("_Res");
const HLSLAttributedResourceType::Attri
@@ -11533,6 +11539,18 @@ QualType ASTContext::mergeTypes(QualType LHS, QualType
RHS, bool OfBlockPointer,
return {};
return LHS;
}
+ case Type::HLSLAttributedResource: {
+const HLSLAttributedResourceType *LHSTy =
+LHS->castAs();
+const HLSLAttribut
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/110327
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4492,6 +4492,37 @@ void CXXNameMangler::mangleType(const ArrayParameterType
*T) {
mangleType(cast(T));
}
+void CXXNameMangler::mangleType(const HLSLAttributedResourceType *T) {
+ llvm::SmallString<64> Str("_Res");
+ const HLSLAttributedResourceType::Attributes &Attrs
@@ -17,12 +17,12 @@ void add(sx10x10_t a, sx5x10_t b, sx10x5_t c) {
// expected-error@-1 {{assigning to 'sx10x10_t' (aka 'float
__attribute__((matrix_type(10, 10)))') from incompatible type 'sx5x10_t' (aka
'float __attribute__((matrix_type(5, 10)))')}}
a = b + &c;
- //
https://github.com/pow2clk updated
https://github.com/llvm/llvm-project/pull/106146
>From 40224473a7b43bc4ffe2024ab51196c2130bedc7 Mon Sep 17 00:00:00 2001
From: Greg Roth
Date: Sun, 25 Aug 2024 12:00:03 -0600
Subject: [PATCH 1/5] [DirectX] Remove trivially dead functions at linkage
finalize
@@ -0,0 +1,222 @@
+; RUN: opt -S -dxil-finalize-linkage
-mtriple=dxil-unknown-shadermodel6.5-compute %s | FileCheck %s
+; RUN: llc %s --filetype=asm -o - | FileCheck %s
pow2clk wrote:
Done!
https://github.com/llvm/llvm-project/pull/106146
__
@@ -17,12 +17,12 @@ void add(sx10x10_t a, sx5x10_t b, sx10x5_t c) {
// expected-error@-1 {{assigning to 'sx10x10_t' (aka 'float
__attribute__((matrix_type(10, 10)))') from incompatible type 'sx5x10_t' (aka
'float __attribute__((matrix_type(5, 10)))')}}
a = b + &c;
- //
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111415
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -852,34 +852,50 @@ void TypePrinter::printExtVectorAfter(const ExtVectorType
*T, raw_ostream &OS) {
void TypePrinter::printConstantMatrixBefore(const ConstantMatrixType *T,
raw_ostream &OS) {
+ if (Policy.UseHLSLTypes)
+OS <
https://github.com/pow2clk updated
https://github.com/llvm/llvm-project/pull/106146
>From 40224473a7b43bc4ffe2024ab51196c2130bedc7 Mon Sep 17 00:00:00 2001
From: Greg Roth
Date: Sun, 25 Aug 2024 12:00:03 -0600
Subject: [PATCH 1/4] [DirectX] Remove trivially dead functions at linkage
finalize
https://github.com/pow2clk updated
https://github.com/llvm/llvm-project/pull/106146
>From 40224473a7b43bc4ffe2024ab51196c2130bedc7 Mon Sep 17 00:00:00 2001
From: Greg Roth
Date: Sun, 25 Aug 2024 12:00:03 -0600
Subject: [PATCH 1/6] [DirectX] Remove trivially dead functions at linkage
finalize
https://github.com/pow2clk closed
https://github.com/llvm/llvm-project/pull/106146
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -356,6 +426,9 @@ struct TemplateParameterListBuilder {
QualType T = Builder.Template->getInjectedClassNameSpecialization();
T = S.Context.getInjectedClassNameType(Builder.Record, T);
+ArrayRef TempArgs =
+Builder.Template->getInjectedTemplateArgs();
@@ -48,11 +48,13 @@ define <4 x i32> @load_static_array_of_vec_test(i32 %index)
{
}
; CHECK-LABEL: multid_load_test
-define <4 x i32> @multid_load_test() {
+define <4 x i32> @multid_load_test() #0 {
; CHECK-COUNT-8: load i32, ptr addrspace(3)
{{(.*@groushared2dArrayofVec
https://github.com/pow2clk closed
https://github.com/llvm/llvm-project/pull/111632
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,47 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -S -o - %s |
FileCheck %s
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -S -o - %s |
FileCheck %s
+
+// Verify that internal linkage unused functions are removed
+
+RWBuffer buf;
+
+// Never
@@ -19,20 +19,20 @@
using namespace llvm;
static bool finalizeLinkage(Module &M) {
- SmallPtrSet EntriesAndExports;
+ SmallPtrSet Funcs;
// Find all entry points and export functions
for (Function &EF : M.functions()) {
-if (!EF.hasFnAttribute("hlsl.shader") && !
@@ -0,0 +1,80 @@
+; RUN: opt -S -dxil-finalize-linkage
-mtriple=dxil-unknown-shadermodel6.5-compute %s | FileCheck %s
+; RUN: llc %s --filetype=asm -o - | FileCheck %s
+
+target triple = "dxilv1.5-pc-shadermodel6.5-compute"
+
+; Confirm that DXILFinalizeLinkage will remove functi
@@ -19,20 +19,20 @@
using namespace llvm;
static bool finalizeLinkage(Module &M) {
- SmallPtrSet EntriesAndExports;
+ SmallPtrSet Funcs;
// Find all entry points and export functions
pow2clk wrote:
Updated
https://github.com/llvm/llvm-project/pull/106
@@ -0,0 +1,48 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -disable-llvm-passes
-emit-llvm -finclude-default-header -o - %s | FileCheck %s
+
+// CHECK-LABEL: increment
+void increment(inout int Arr[2]) {
+ for (int I = 0; I < 2; I++)
+Arr[0] += 2;
+}
+
+// C
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111047
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pow2clk commented:
Just a drive by review with one additional note while searching for changes
that will be disrupted by the mangling shift.
https://github.com/llvm/llvm-project/pull/111047
___
cfe-commits mailing list
cfe-commits@l
@@ -1,9 +1,53 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm
-O1 -o - %s | FileCheck %s
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library
-finclude-default-header -x hlsl -emit-llvm -o - %s | FileCheck %s
-void foo(__hlsl_resource_t r
@@ -0,0 +1,48 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-library -disable-llvm-passes
-emit-llvm -finclude-default-header -o - %s | FileCheck %s
+
+// CHECK-LABEL: increment
+void increment(inout int Arr[2]) {
+ for (int I = 0; I < 2; I++)
+Arr[0] += 2;
+}
+
+// C
@@ -1,19 +1,20 @@
-// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm
-disable-llvm-passes -o - %s | FileCheck %s
-// RUN: %clang_cc1 -triple spirv-vulkan-library -x hlsl -emit-llvm
-disable-llvm-passes -o - %s | FileCheck %s --check-prefix=CHECK-SPIRV
@@ -17,12 +17,12 @@ void add(sx10x10_t a, sx5x10_t b, sx10x5_t c) {
// expected-error@-1 {{assigning to 'sx10x10_t' (aka 'float
__attribute__((matrix_type(10, 10)))') from incompatible type 'sx5x10_t' (aka
'float __attribute__((matrix_type(5, 10)))')}}
a = b + &c;
- //
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111415
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/111415
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1381,7 +1381,7 @@ void ASTContext::InitBuiltinTypes(const TargetInfo
&Target,
if (LangOpts.OpenACC && !LangOpts.OpenMP) {
InitBuiltinType(ArraySectionTy, BuiltinType::ArraySection);
}
- if (LangOpts.MatrixTypes)
+ if (LangOpts.MatrixTypes || LangOpts.HLSL)
--
@@ -852,34 +852,50 @@ void TypePrinter::printExtVectorAfter(const ExtVectorType
*T, raw_ostream &OS) {
void TypePrinter::printConstantMatrixBefore(const ConstantMatrixType *T,
raw_ostream &OS) {
+ if (Policy.UseHLSLTypes)
+OS <
@@ -1381,7 +1381,7 @@ void ASTContext::InitBuiltinTypes(const TargetInfo
&Target,
if (LangOpts.OpenACC && !LangOpts.OpenMP) {
InitBuiltinType(ArraySectionTy, BuiltinType::ArraySection);
}
- if (LangOpts.MatrixTypes)
+ if (LangOpts.MatrixTypes || LangOpts.HLSL)
--
@@ -1762,6 +1765,36 @@ bool SPIRVInstructionSelector::selectSign(Register
ResVReg,
return Result;
}
+bool SPIRVInstructionSelector::selectWaveActiveCountBits(
+Register ResVReg, const SPIRVType *ResType, MachineInstr &I) const {
+ assert(I.getNumOperands() == 3);
+ as
@@ -1762,6 +1765,36 @@ bool SPIRVInstructionSelector::selectSign(Register
ResVReg,
return Result;
}
+bool SPIRVInstructionSelector::selectWaveActiveCountBits(
+Register ResVReg, const SPIRVType *ResType, MachineInstr &I) const {
+ assert(I.getNumOperands() == 3);
+ as
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
+// RUN: dxil-pc-shadermodel6.3-compute %s -emit-llvm -disable-llvm-passes -o
- | \
+// RUN: FileCheck %s --check-prefixes=CHECK,CHECK-DXIL
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-defaul
https://github.com/pow2clk commented:
Looks good! The only change I think is essential is the missing
`constrainAllUses`
https://github.com/llvm/llvm-project/pull/113382
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cg
@@ -17,12 +17,12 @@ void add(sx10x10_t a, sx5x10_t b, sx10x5_t c) {
// expected-error@-1 {{assigning to 'sx10x10_t' (aka 'float
__attribute__((matrix_type(10, 10)))') from incompatible type 'sx5x10_t' (aka
'float __attribute__((matrix_type(5, 10)))')}}
a = b + &c;
- //
@@ -852,34 +852,51 @@ void TypePrinter::printExtVectorAfter(const ExtVectorType
*T, raw_ostream &OS) {
void TypePrinter::printConstantMatrixBefore(const ConstantMatrixType *T,
raw_ostream &OS) {
+ if (Policy.UseHLSLTypes)
+OS <
@@ -1,7 +1,5 @@
// RUN: %clang_cc1 -O0 -fenable-matrix -triple x86_64-apple-darwin %s
-emit-llvm -disable-llvm-passes -o - -std=c++11 | FileCheck
--check-prefixes=CHECK,NOOPT %s
// RUN: %clang_cc1 -O1 -fenable-matrix -triple x86_64-apple-darwin %s
-emit-llvm -disable-llvm-pas
@@ -2527,6 +2640,11 @@ bool SPIRVInstructionSelector::selectIntrinsic(Register
ResVReg,
case Intrinsic::spv_udot:
case Intrinsic::spv_sdot:
return selectIntegerDot(ResVReg, ResType, I);
+ case Intrinsic::spv_dot4add_i8packed:
+if (STI.canUseExtension(SPIRV::Extens
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/113623
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pow2clk approved this pull request.
Looks good! I learned a couple things about SPIR-V by verifying this.
Just one quibble about the language version and a suggested followup.
https://github.com/llvm/llvm-project/pull/113623
___
cf
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -std=hlsl2021 -finclude-default-header -triple \
pow2clk wrote:
202x is the default. Is there a reason this requires 2021?
https://github.com/llvm/llvm-project/pull/113623
___
cfe-c
https://github.com/pow2clk edited
https://github.com/llvm/llvm-project/pull/113382
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -820,3 +820,12 @@ def WaveGetLaneIndex : DXILOp<111, waveGetLaneIndex> {
let stages = [Stages];
let attributes = [Attributes];
}
+
+def WaveAllBitCount : DXILOp<135, waveAllOp> {
pow2clk wrote:
Initially, I thought this couldn't be right since the latte
@@ -1880,6 +1880,31 @@ static bool CheckVectorSelect(Sema *S, CallExpr
*TheCall) {
return false;
}
+static bool CheckResourceHandle(Sema *S, CallExpr *TheCall, unsigned ArgIndex)
{
+ assert(TheCall->getNumArgs() >= ArgIndex);
+ QualType ArgType = TheCall->getArg(ArgIndex
https://github.com/pow2clk approved this pull request.
Thanks for indulging me!
https://github.com/llvm/llvm-project/pull/113643
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/pow2clk updated
https://github.com/llvm/llvm-project/pull/106146
>From 1e39029007dee5825810965fa39f26996ec9b7aa Mon Sep 17 00:00:00 2001
From: Greg Roth
Date: Sun, 25 Aug 2024 12:00:03 -0600
Subject: [PATCH] [DirectX] Remove trivially dead functions at linkage finalize
Funct
https://github.com/pow2clk updated
https://github.com/llvm/llvm-project/pull/106146
>From 70d4b5de3e9a214d50560f047b334de7f0818167 Mon Sep 17 00:00:00 2001
From: Greg Roth
Date: Sun, 25 Aug 2024 12:00:03 -0600
Subject: [PATCH] [DirectX] Remove trivially dead functions at linkage finalize
Funct
@@ -19,20 +19,20 @@
using namespace llvm;
static bool finalizeLinkage(Module &M) {
- SmallPtrSet EntriesAndExports;
+ SmallPtrSet Funcs;
// Find all entry points and export functions
for (Function &EF : M.functions()) {
-if (!EF.hasFnAttribute("hlsl.shader") && !
https://github.com/pow2clk updated
https://github.com/llvm/llvm-project/pull/106146
>From 40224473a7b43bc4ffe2024ab51196c2130bedc7 Mon Sep 17 00:00:00 2001
From: Greg Roth
Date: Sun, 25 Aug 2024 12:00:03 -0600
Subject: [PATCH] [DirectX] Remove trivially dead functions at linkage finalize
Funct
https://github.com/pow2clk ready_for_review
https://github.com/llvm/llvm-project/pull/106146
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
101 - 200 of 247 matches
Mail list logo