@@ -108,3 +108,16 @@ behavior between Clang and DXC. Some examples include:
diagnostic notifying the user of the conversion rather than silently altering
precision relative to the other overloads (as FXC does) or generating code
that will fail validation (as DXC does).
+
https://github.com/bharadwajy closed
https://github.com/llvm/llvm-project/pull/91407
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bharadwajy wrote:
> It would be nice to mention in the description what the sanitizer fix was
> compared to the original PR.
Thanks! The fix to address ASAN failure is in commit
8522e3609869d72b7b457a4752149a802be4662d of this PR. Updated the description as
well.
https://github.com/bharadwajy edited
https://github.com/llvm/llvm-project/pull/91407
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bharadwajy created
https://github.com/llvm/llvm-project/pull/91407
This change set restores the PR #90809 that was reverted to address ASAN
failures and includes a fix for the ASAN failures.
Following is the description of the change:
An earlier commit provided a way to
https://github.com/bharadwajy closed
https://github.com/llvm/llvm-project/pull/91290
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bharadwajy created
https://github.com/llvm/llvm-project/pull/91290
Reverts llvm/llvm-project#90809
Need to investigate ASAN failures.
>From 3be739599982371e6151561758928007d4dc2762 Mon Sep 17 00:00:00 2001
From: "S. Bharadwaj Yadavalli"
Date: Mon, 6 May 2024 22:16:35 -0400
bharadwajy wrote:
> Now the #90809 has landed, is this PR still relevant?
No. I was just about to close it. Thanks!
Closing as an expanded implementation has been merged.
https://github.com/llvm/llvm-project/pull/89823
___
cfe-commits mailing list
https://github.com/bharadwajy closed
https://github.com/llvm/llvm-project/pull/89823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bharadwajy closed
https://github.com/llvm/llvm-project/pull/90809
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bharadwajy updated
https://github.com/llvm/llvm-project/pull/90809
>From 3b74e41492aeb916487105b05316f8db255c57c3 Mon Sep 17 00:00:00 2001
From: Bharadwaj Yadavalli
Date: Wed, 1 May 2024 14:42:42 -0400
Subject: [PATCH 1/7] Set DXIL Version in DXIL target triple based on
https://github.com/bharadwajy updated
https://github.com/llvm/llvm-project/pull/90809
>From 3b74e41492aeb916487105b05316f8db255c57c3 Mon Sep 17 00:00:00 2001
From: Bharadwaj Yadavalli
Date: Wed, 1 May 2024 14:42:42 -0400
Subject: [PATCH 1/6] Set DXIL Version in DXIL target triple based on
@@ -2454,4 +2454,19 @@ TEST(TripleTest, isArmMClass) {
EXPECT_TRUE(T.isArmMClass());
}
}
+
+TEST(TripleTest, DXILNormaizeWithVersion) {
+ EXPECT_EQ("dxilv1.0-unknown-shadermodel6.0",
+Triple::normalize("dxilv1.0--shadermodel6.0"));
@@ -2454,4 +2454,19 @@ TEST(TripleTest, isArmMClass) {
EXPECT_TRUE(T.isArmMClass());
}
}
+
+TEST(TripleTest, DXILNormaizeWithVersion) {
+ EXPECT_EQ("dxilv1.0-unknown-shadermodel6.0",
+Triple::normalize("dxilv1.0--shadermodel6.0"));
https://github.com/bharadwajy edited
https://github.com/llvm/llvm-project/pull/90809
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2454,4 +2454,19 @@ TEST(TripleTest, isArmMClass) {
EXPECT_TRUE(T.isArmMClass());
}
}
+
+TEST(TripleTest, DXILNormaizeWithVersion) {
+ EXPECT_EQ("dxilv1.0-unknown-shadermodel6.0",
+Triple::normalize("dxilv1.0--shadermodel6.0"));
@@ -115,6 +115,30 @@ StringRef Triple::getArchName(ArchType Kind, SubArchType
SubArch) {
if (SubArch == AArch64SubArch_arm64e)
return "arm64e";
break;
+ case Triple::dxil:
+switch (SubArch) {
+case Triple::NoSubArch:
+case Triple::DXILSubArch_v1_0:
@@ -744,7 +744,7 @@ void codegen::setFunctionAttributes(StringRef CPU,
StringRef Features,
Expected>
codegen::createTargetMachineForTriple(StringRef TargetTriple,
CodeGenOptLevel OptLevel) {
- Triple TheTriple(TargetTriple);
+ Triple
https://github.com/bharadwajy updated
https://github.com/llvm/llvm-project/pull/90809
>From 1b6bb5bf115c9f72adde27b6d77d957edbc49321 Mon Sep 17 00:00:00 2001
From: Bharadwaj Yadavalli
Date: Wed, 1 May 2024 14:42:42 -0400
Subject: [PATCH 1/6] Set DXIL Version in DXIL target triple based on
@@ -630,7 +630,7 @@ extern "C" int optMain(
}
}
- Triple ModuleTriple(M->getTargetTriple());
+ Triple ModuleTriple(Triple::normalize(M->getTargetTriple()));
bharadwajy wrote:
> Similarly to my concern about updating `createTargetMachineForTriple`, I
https://github.com/bharadwajy updated
https://github.com/llvm/llvm-project/pull/90809
>From 1b6bb5bf115c9f72adde27b6d77d957edbc49321 Mon Sep 17 00:00:00 2001
From: Bharadwaj Yadavalli
Date: Wed, 1 May 2024 14:42:42 -0400
Subject: [PATCH 1/5] Set DXIL Version in DXIL target triple based on
@@ -744,7 +744,7 @@ void codegen::setFunctionAttributes(StringRef CPU,
StringRef Features,
Expected>
codegen::createTargetMachineForTriple(StringRef TargetTriple,
CodeGenOptLevel OptLevel) {
- Triple TheTriple(TargetTriple);
+ Triple
https://github.com/bharadwajy updated
https://github.com/llvm/llvm-project/pull/90809
>From 1b6bb5bf115c9f72adde27b6d77d957edbc49321 Mon Sep 17 00:00:00 2001
From: Bharadwaj Yadavalli
Date: Wed, 1 May 2024 14:42:42 -0400
Subject: [PATCH 1/4] Set DXIL Version in DXIL target triple based on
@@ -4675,7 +4676,7 @@ bool CompilerInvocation::CreateFromArgsImpl(
// FIXME: We shouldn't have to pass the DashX option around here
InputKind DashX = Res.getFrontendOpts().DashX;
ParseTargetArgs(Res.getTargetOpts(), Args, Diags);
- llvm::Triple
https://github.com/bharadwajy updated
https://github.com/llvm/llvm-project/pull/90809
>From 1b6bb5bf115c9f72adde27b6d77d957edbc49321 Mon Sep 17 00:00:00 2001
From: Bharadwaj Yadavalli
Date: Wed, 1 May 2024 14:42:42 -0400
Subject: [PATCH 1/3] Set DXIL Version in DXIL target triple based on
https://github.com/bharadwajy edited
https://github.com/llvm/llvm-project/pull/90809
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1200,6 +1224,27 @@ std::string Triple::normalize(StringRef Str) {
}
}
+ // Normalize DXIL triple if it does not include DXIL version number.
+ // Determine DXIL version number using the minor version number of Shader
+ // Model version specified in target triple,
@@ -1200,6 +1224,27 @@ std::string Triple::normalize(StringRef Str) {
}
}
+ // Normalize DXIL triple if it does not include DXIL version number.
+ // Determine DXIL version number using the minor version number of Shader
+ // Model version specified in target triple,
https://github.com/bharadwajy updated
https://github.com/llvm/llvm-project/pull/90809
>From 1b6bb5bf115c9f72adde27b6d77d957edbc49321 Mon Sep 17 00:00:00 2001
From: Bharadwaj Yadavalli
Date: Wed, 1 May 2024 14:42:42 -0400
Subject: [PATCH 1/2] Set DXIL Version in DXIL target triple based on
https://github.com/bharadwajy edited
https://github.com/llvm/llvm-project/pull/89823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4675,7 +4676,7 @@ bool CompilerInvocation::CreateFromArgsImpl(
// FIXME: We shouldn't have to pass the DashX option around here
InputKind DashX = Res.getFrontendOpts().DashX;
ParseTargetArgs(Res.getTargetOpts(), Args, Diags);
- llvm::Triple
@@ -115,6 +115,30 @@ StringRef Triple::getArchName(ArchType Kind, SubArchType
SubArch) {
if (SubArch == AArch64SubArch_arm64e)
return "arm64e";
break;
+ case Triple::dxil:
+switch (SubArch) {
+case Triple::NoSubArch:
bharadwajy wrote:
@@ -760,7 +760,7 @@ using namespace clang::targets;
TargetInfo *
TargetInfo::CreateTargetInfo(DiagnosticsEngine ,
const std::shared_ptr ) {
- llvm::Triple Triple(Opts->Triple);
+ llvm::Triple Triple(llvm::Triple::normalize(Opts->Triple));
@@ -115,6 +115,30 @@ StringRef Triple::getArchName(ArchType Kind, SubArchType
SubArch) {
if (SubArch == AArch64SubArch_arm64e)
return "arm64e";
break;
+ case Triple::dxil:
+switch (SubArch) {
+case Triple::NoSubArch:
+case Triple::DXILSubArch_v1_0:
https://github.com/bharadwajy created
https://github.com/llvm/llvm-project/pull/90809
An earlier commit provided a way to decouple DXIL version from Shader Model
version
by representing the DXIL version as `SubArch` in the DXIL Target Triple and
adding
corresponding valid DXIL Arch types.
@@ -2616,6 +2617,13 @@ bool Sema::IsFloatingPointPromotion(QualType FromType,
QualType ToType) {
ToBuiltin->getKind() == BuiltinType::Ibm128))
return true;
+ // In HLSL, `half` promotes to `float` or `double`, regardless of whether
+ // or not
https://github.com/bharadwajy approved this pull request.
https://github.com/llvm/llvm-project/pull/90277
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -2,39 +2,45 @@
// Supported targets
//
-// RUN: %clang -target dxil--shadermodel6.2-pixel %s -S -o /dev/null 2>&1 |
FileCheck --check-prefix=CHECK-VALID %s
-// RUN: %clang -target dxil-unknown-shadermodel6.2-pixel %s -S -o /dev/null
2>&1 | FileCheck
@@ -98,9 +103,47 @@ std::optional tryParseProfile(StringRef
Profile) {
else if (llvm::getAsUnsignedInteger(Parts[2], 0, Minor))
return std::nullopt;
- // dxil-unknown-shadermodel-hull
+ // Determine DXIL version number using the minor version number of Shader
+ //
@@ -2,39 +2,45 @@
// Supported targets
//
-// RUN: %clang -target dxil--shadermodel6.2-pixel %s -S -o /dev/null 2>&1 |
FileCheck --check-prefix=CHECK-VALID %s
-// RUN: %clang -target dxil-unknown-shadermodel6.2-pixel %s -S -o /dev/null
2>&1 | FileCheck
@@ -68,25 +68,25 @@ TEST(DxcModeTest, TargetProfileValidation) {
IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions();
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagConsumer);
- validateTargetProfile("-Tvs_6_0", "dxil--shadermodel6.0-vertex",
+
@@ -68,25 +68,25 @@ TEST(DxcModeTest, TargetProfileValidation) {
IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions();
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagConsumer);
- validateTargetProfile("-Tvs_6_0", "dxil--shadermodel6.0-vertex",
+
https://github.com/bharadwajy edited
https://github.com/llvm/llvm-project/pull/89823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bharadwajy edited
https://github.com/llvm/llvm-project/pull/89823
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -68,25 +68,25 @@ TEST(DxcModeTest, TargetProfileValidation) {
IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions();
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagConsumer);
- validateTargetProfile("-Tvs_6_0", "dxil--shadermodel6.0-vertex",
+
@@ -98,9 +100,47 @@ std::optional tryParseProfile(StringRef
Profile) {
else if (llvm::getAsUnsignedInteger(Parts[2], 0, Minor))
return std::nullopt;
- // dxil-unknown-shadermodel-hull
+ // Determine DXIL version number using the minor version number of Shader
+ //
@@ -68,25 +68,25 @@ TEST(DxcModeTest, TargetProfileValidation) {
IntrusiveRefCntPtr DiagOpts = new DiagnosticOptions();
DiagnosticsEngine Diags(DiagID, &*DiagOpts, DiagConsumer);
- validateTargetProfile("-Tvs_6_0", "dxil--shadermodel6.0-vertex",
+
https://github.com/bharadwajy approved this pull request.
https://github.com/llvm/llvm-project/pull/87078
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bharadwajy approved this pull request.
https://github.com/llvm/llvm-project/pull/86071
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -295,6 +295,15 @@ def IMad : DXILOpMapping<48, tertiary, int_dx_imad,
"Signed integer arithmetic multiply/add operation.
imad(m,a,b) = m * a + b.">;
def UMad : DXILOpMapping<49, tertiary, int_dx_umad,
"Unsigned integer
https://github.com/bharadwajy approved this pull request.
https://github.com/llvm/llvm-project/pull/84820
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -114,6 +114,44 @@ not re-targetable, we want to share the Clang CodeGen
implementation for HLSL
with other GPU graphics targets like SPIR-V and possibly other GPU and even CPU
targets.
+hlsl.h
+--
+
+HLSL has an extensive library of functionality. This is similar to
@@ -114,6 +114,44 @@ not re-targetable, we want to share the Clang CodeGen
implementation for HLSL
with other GPU graphics targets like SPIR-V and possibly other GPU and even CPU
targets.
+hlsl.h
+--
+
+HLSL has an extensive library of functionality. This is similar to
@@ -114,6 +114,44 @@ not re-targetable, we want to share the Clang CodeGen
implementation for HLSL
with other GPU graphics targets like SPIR-V and possibly other GPU and even CPU
targets.
+hlsl.h
+--
+
+HLSL has an extensive library of functionality. This is similar to
https://github.com/bharadwajy approved this pull request.
Consider consistent spelling of the term "built in" consistently - whichever is
preferred.
https://github.com/llvm/llvm-project/pull/84081
___
cfe-commits mailing list
https://github.com/bharadwajy edited
https://github.com/llvm/llvm-project/pull/83826
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bharadwajy approved this pull request.
https://github.com/llvm/llvm-project/pull/83826
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,67 @@
+; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
+
+; Make sure dxil operation function calls for round are generated for float
and half.
+; CHECK:call half @dx.op.tertiary.f16(i32 46, half %{{.*}}, half %{{.*}}, half
%{{.*}})
+; CHECK:call float
@@ -0,0 +1,43 @@
+; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
+
+; Make sure dxil operation function calls for round are generated for float
and half.
+; CHECK:call float @dx.op.unary.f32(i32 26, float %{{.*}})
+; CHECK:call half @dx.op.unary.f16(i32 26, half %{{.*}})
+
@@ -0,0 +1,43 @@
+; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
+
+; Make sure dxil operation function calls for round are generated for float
and half.
+; CHECK:call float @dx.op.unary.f32(i32 26, float %{{.*}})
+; CHECK:call half @dx.op.unary.f16(i32 26, half %{{.*}})
+
@@ -0,0 +1,43 @@
+; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
+
+; Make sure dxil operation function calls for round are generated for float
and half.
+; CHECK:call float @dx.op.unary.f32(i32 26, float %{{.*}})
+; CHECK:call half @dx.op.unary.f16(i32 26, half %{{.*}})
+
@@ -220,6 +220,9 @@ def Sin : DXILOpMapping<13, unary, int_sin,
"Returns sine(theta) for theta in radians.">;
def UMax : DXILOpMapping<39, binary, int_umax,
"Unsigned integer maximum. UMax(a,b) = a > b ? a :
b">;
+def Round :
@@ -831,6 +831,40 @@ uint64_t3 reversebits(uint64_t3);
_HLSL_BUILTIN_ALIAS(__builtin_elementwise_bitreverse)
uint64_t4 reversebits(uint64_t4);
+//===--===//
+// frac builtins
@@ -0,0 +1,43 @@
+; RUN: opt -S -dxil-op-lower < %s | FileCheck %s
+
+; Make sure dxil operation function calls for round are generated for float
and half.
+; CHECK:call float @dx.op.unary.f32(i32 26, float %{{.*}})
+; CHECK:call half @dx.op.unary.f16(i32 26, half %{{.*}})
+
https://github.com/bharadwajy approved this pull request.
A few simple suggestions. Otherwise looks good.
https://github.com/llvm/llvm-project/pull/83570
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://github.com/bharadwajy edited
https://github.com/llvm/llvm-project/pull/83570
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -5246,6 +5246,23 @@ bool CheckVectorElementCallArgs(Sema *S, CallExpr
*TheCall) {
return true;
}
+bool CheckAllArgsAreFloatRepresentation(Sema *S, CallExpr *TheCall) {
bharadwajy wrote:
Consider changing the function name to either
https://github.com/bharadwajy approved this pull request.
https://github.com/llvm/llvm-project/pull/82395
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bharadwajy edited
https://github.com/llvm/llvm-project/pull/82395
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,107 @@
+
+Expected Differences vs DXC and FXC
+===
+
+.. contents::
+ :local:
+
+Introduction
+
+
+HLSL currently has two reference compilers, the `DirectX Shader Compiler (DXC)
https://github.com/bharadwajy approved this pull request.
Works! LGTM!
https://github.com/llvm/llvm-project/pull/81052
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
71 matches
Mail list logo