@@ -314,64 +314,92 @@ void Parser::ParseGNUAttributes(ParsedAttributes &Attrs,
}
/// Determine whether the given attribute has an identifier argument.
-static bool attributeHasIdentifierArg(const IdentifierInfo &II) {
+static bool attributeHasIdentifierArg(const IdentifierInfo
@@ -191,6 +191,12 @@ class AttributeCommonInfo {
/// __gnu__::__attr__ will be normalized to gnu::attr).
std::string getNormalizedFullName() const;
+ /// Gets a normalized full name, with syntax, scope and name.
+ static std::string
+ getNormalizedFullNameWithSyntax(con
@@ -245,6 +274,20 @@ void SemaHLSL::CheckEntryPoint(FunctionDecl *FD) {
<< llvm::Triple::getEnvironmentTypeName(ST);
FD->setInvalidDecl();
}
+if (const auto *NT = FD->getAttr()) {
+ if (Ver.getMajor() < 6u ||
+ (Ver.getMajor() == 6u && Ver.
@@ -245,6 +274,20 @@ void SemaHLSL::CheckEntryPoint(FunctionDecl *FD) {
<< llvm::Triple::getEnvironmentTypeName(ST);
FD->setInvalidDecl();
}
+if (const auto *NT = FD->getAttr()) {
+ if (Ver.getMajor() < 6u ||
+ (Ver.getMajor() == 6u && Ver.
@@ -348,6 +391,77 @@ void SemaHLSL::handleNumThreadsAttr(Decl *D, const
ParsedAttr &AL) {
D->addAttr(NewAttr);
}
+void SemaHLSL::handleWaveSizeAttr(Decl *D, const ParsedAttr &AL) {
+ // validate that the wavesize argument is a power of 2 between 4 and 128
+ // inclusive
bogner wrote:
Just noticed that this was missing the change I had locally for updating the
load and store operations to reflect the two different buffer types. I've
pushed that in the latest update.
https://github.com/llvm/llvm-project/pull/90553
___
https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/90553
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
lgtm
https://github.com/llvm/llvm-project/pull/97111
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -7334,6 +7334,100 @@ static void handleHLSLShaderAttr(Sema &S, Decl *D,
const ParsedAttr &AL) {
D->addAttr(NewAttr);
}
+static void DiagnoseHLSLResourceRegType(Sema &S, SourceLocation &ArgLoc,
+Decl *D, StringRef &Slot) {
+ // S
@@ -0,0 +1,74 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -o -
-fsyntax-only %s -verify
+
+// the below will cause an llvm unreachable, because RWBuffers don't have
resource attributes yet
+// expected-error@+1 {{invalid register name prefix 'b' for re
@@ -25,6 +25,7 @@ enum class ResourceClass : uint8_t {
SRV = 0,
UAV,
CBuffer,
+ TBuffer,
bogner wrote:
I hadn't noticed this. Xiang's right, this isn't correct. See
`CGHLSLRuntime::finishCodeGen` - a tbuffer is annotated with a resource class
of `SRV`
https://github.com/bogner 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/bogner requested changes to this pull request.
There's a lot of churn here so I'm not 100% sure I saw all of the real changes,
but I think I got them all. It might be nice to move the NFC parts into their
own commit (if we actually need them, see my other comments).
I don't
@@ -1171,18 +1181,27 @@ TEST(TripleTest, Normalization) {
Triple::getOSTypeName(FirstOSType),
Triple::getEnvironmentTypeName(FirstEnvType)};
for (int Arch = FirstArchType; Arch <= Triple::LastArchType; ++Arch) {
-StringR
@@ -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
+ // Mo
@@ -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 --check-prefix=CHECK-V
@@ -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::DXILSubArch_v1_0:
+ return "dxilv1.0";
+
@@ -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 --check-prefix=CHECK-V
@@ -7334,6 +7334,92 @@ static void handleHLSLShaderAttr(Sema &S, Decl *D, const
ParsedAttr &AL) {
D->addAttr(NewAttr);
}
+static void DiagnoseHLSLResourceRegType(Sema &S, SourceLocation &ArgLoc,
+Decl *D, StringRef &Slot) {
+ // Sa
@@ -7334,6 +7334,92 @@ static void handleHLSLShaderAttr(Sema &S, Decl *D, const
ParsedAttr &AL) {
D->addAttr(NewAttr);
}
+static void DiagnoseHLSLResourceRegType(Sema &S, SourceLocation &ArgLoc,
+Decl *D, StringRef &Slot) {
+ // Sa
@@ -0,0 +1,799 @@
+==
+DXIL Resource Handling
+==
+
+.. contents::
+ :local:
+
+.. toctree::
+ :hidden:
+
+Introduction
+
+
+Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and
+eventually lowered by the Di
@@ -0,0 +1,799 @@
+==
+DXIL Resource Handling
+==
+
+.. contents::
+ :local:
+
+.. toctree::
+ :hidden:
+
+Introduction
+
+
+Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and
+eventually lowered by the Di
@@ -0,0 +1,799 @@
+==
+DXIL Resource Handling
+==
+
+.. contents::
+ :local:
+
+.. toctree::
+ :hidden:
+
+Introduction
+
+
+Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and
+eventually lowered by the Di
@@ -0,0 +1,799 @@
+==
+DXIL Resource Handling
+==
+
+.. contents::
+ :local:
+
+.. toctree::
+ :hidden:
+
+Introduction
+
+
+Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and
+eventually lowered by the Di
@@ -0,0 +1,799 @@
+==
+DXIL Resource Handling
+==
+
+.. contents::
+ :local:
+
+.. toctree::
+ :hidden:
+
+Introduction
+
+
+Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and
+eventually lowered by the Di
@@ -16,262 +16,220 @@
#ifdef __HLSL_ENABLE_16_BIT
// DXIL_NATIVE_HALF: define noundef i1 @
// SPIR_NATIVE_HALF: define spir_func noundef i1 @
-// DXIL_NATIVE_HALF: %hlsl.all = call i1 @llvm.dx.all.i16
-// SPIR_NATIVE_HALF: %hlsl.all = call i1 @llvm.spv.all.i16
+// DXIL_NATIVE_H
@@ -1,12 +1,12 @@
-// RUN: %clang_cc1 -triple spirv-vulkan-library -x hlsl -emit-llvm
-disable-llvm-passes -o - %s | FileCheck %s --check-prefix=CHECK-SPIRV
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -x hlsl -emit-llvm
-disable-llvm-passes -o - %s | FileCheck %s
https://github.com/bogner commented:
I think this looks basically reasonable, though some parts are a bit hard to
decipher without the actual attributed types present yet. We probably need
someone familar with the clang AST, Sema, and serialization to take a look as
well - maybe @AaronBallman?
@@ -6155,6 +6155,63 @@ class BTFTagAttributedType : public Type, public
llvm::FoldingSetNode {
}
};
+class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
+public:
+ struct Attributes {
+// This is where data gathered from HLSL resource attribut
@@ -2048,6 +2049,17 @@ void TypePrinter::printBTFTagAttributedAfter(const
BTFTagAttributedType *T,
printAfter(T->getWrappedType(), OS);
}
+void TypePrinter::printHLSLAttributedResourceBefore(
+const HLSLAttributedResourceType *T, raw_ostream &OS) {
+ printBefore(T->get
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/106181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/106181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -6155,6 +6155,53 @@ class BTFTagAttributedType : public Type, public
llvm::FoldingSetNode {
}
};
+class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
+public:
+ struct Attributes {
+// Data gathered from HLSL resource attributes
+uint8_
https://github.com/bogner approved this pull request.
A few nitpicks, but otherwise LGTM!
https://github.com/llvm/llvm-project/pull/106181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi
@@ -2048,6 +2049,24 @@ void TypePrinter::printBTFTagAttributedAfter(const
BTFTagAttributedType *T,
printAfter(T->getWrappedType(), OS);
}
+void TypePrinter::printHLSLAttributedResourceBefore(
+const HLSLAttributedResourceType *T, raw_ostream &OS) {
+ printBefore(T->get
@@ -6155,6 +6155,53 @@ class BTFTagAttributedType : public Type, public
llvm::FoldingSetNode {
}
};
+class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
+public:
+ struct Attributes {
+// Data gathered from HLSL resource attributes
+uint8_
@@ -6155,6 +6155,53 @@ class BTFTagAttributedType : public Type, public
llvm::FoldingSetNode {
}
};
+class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
+public:
+ struct Attributes {
+// Data gathered from HLSL resource attributes
+uint8_
@@ -6155,6 +6155,53 @@ class BTFTagAttributedType : public Type, public
llvm::FoldingSetNode {
}
};
+class HLSLAttributedResourceType : public Type, public llvm::FoldingSetNode {
+public:
+ struct Attributes {
+// Data gathered from HLSL resource attributes
+uint8_
@@ -799,6 +799,19 @@ static bool
IsEquivalentExceptionSpec(StructuralEquivalenceContext &Context,
return true;
}
+// Determine structural equivalence of two instances of
+// HLSLAttributedResourceType::Attributes
+static bool
+IsStructurallyEquivalent(StructuralEquivalenceC
https://github.com/bogner edited
https://github.com/llvm/llvm-project/pull/106181
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -1,98 +1,83 @@
// 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,DXIL_CHECK,DXIL_NATIVE_HALF,NATIVE_
https://github.com/bogner approved this pull request.
Looks great, thanks! Do you need someone to commit this for you?
https://github.com/llvm/llvm-project/pull/105930
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-b
https://github.com/bogner 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
@@ -15,49 +15,49 @@
// RUN: -o - | FileCheck %s --check-prefixes=CHECK,NO_HALF,SPIR_CHECK
#ifdef __HLSL_ENABLE_16_BIT
-// DXIL_NATIVE_HALF: %dx.umad = call i16 @llvm.dx.umad.i16(i16 %0, i16 %1, i16
%2)
+// DXIL_NATIVE_HALF: %dx.umad = call i16 @llvm.[[ICF:dx]].umad.i16(i16
https://github.com/bogner closed
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
@@ -153,6 +154,25 @@ HLSLNumThreadsAttr *SemaHLSL::mergeNumThreadsAttr(Decl *D,
HLSLNumThreadsAttr(getASTContext(), AL, X, Y, Z);
}
+HLSLWaveSizeAttr *SemaHLSL::mergeWaveSizeAttr(Decl *D,
+ const AttributeCommonInfo &AL,
+
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/101240
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/104474
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/106686
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/106657
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -612,57 +588,61 @@ static RegisterBindingFlags
HLSLFillRegisterBindingFlags(Sema &S,
return Flags;
}
- if (!isDeclaredWithinCOrTBuffer(TheDecl)) {
-// make sure the type is a basic / numeric type
-if (TheVarDecl) {
- QualType TheQualTy = TheVarDecl->get
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/97505
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
It's kind of unfortunate how this works dependency-wise - we end up creating
"Debug/share/clang-doc/${f}" even when we only build "Release" and vice-versa,
as the "copy-clang-doc-assets" explicitly depends on each version of this file.
Also
@@ -25,12 +25,14 @@ set(assets
)
set(asset_dir "${CMAKE_CURRENT_SOURCE_DIR}/../assets")
-set(resource_dir "${CMAKE_BINARY_DIR}/share/clang-doc")
set(out_files)
function(copy_files_to_dst src_dir dst_dir file)
set(src "${src_dir}/${file}")
set(dst "${dst_dir}/${file}"
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/97854
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -437,6 +437,49 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr
&AL) {
D->addAttr(NewAttr);
}
+llvm::dxil::ResourceClass
+getResourceClassFromStr(StringRef ResourceClassTypeStrRef) {
+ if (ResourceClassTypeStrRef == "SRV")
+return llvm::dxil::ResourceC
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o
- %s | FileCheck %s
+
+
+// CHECK: -HLSLResourceClassAttr 0x{{[0-9a-f]+}} <> SRV
+struct [[hlsl::resource_class(SRV)]] Eg1 {
+ int i;
+};
+
+Eg1 e1;
+
+// CHECK: -CXXRecordDecl 0x{
@@ -0,0 +1,23 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -o - %s -verify
+
+// expected-error@+1{{'resource_class' attribute takes one argument}}
+struct [[hlsl::resource_class()]] Eg1 {
+ int i;
+};
+
+Eg1 e1;
+
+// expected-error@+1{{invalid resource class
@@ -437,6 +437,49 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr
&AL) {
D->addAttr(NewAttr);
}
+llvm::dxil::ResourceClass
+getResourceClassFromStr(StringRef ResourceClassTypeStrRef) {
+ if (ResourceClassTypeStrRef == "SRV")
+return llvm::dxil::ResourceC
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o
- %s | FileCheck %s
+
+
+// CHECK: -HLSLResourceClassAttr 0x{{[0-9a-f]+}} <> SRV
+struct [[hlsl::resource_class(SRV)]] Eg1 {
bogner wrote:
For the purpose of these t
@@ -0,0 +1,38 @@
+// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.0-compute -x hlsl -ast-dump -o
- %s | FileCheck %s
+
+
+// CHECK: -HLSLResourceClassAttr 0x{{[0-9a-f]+}} <> SRV
+struct [[hlsl::resource_class(SRV)]] Eg1 {
bogner wrote:
Ah, I hadn't noticed the "
@@ -437,6 +437,33 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr
&AL) {
D->addAttr(NewAttr);
}
+void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) {
+ if (!AL.isArgIdent(0)) {
+Diag(AL.getLoc(), diag::err_attribute_argument_type)
+
@@ -437,6 +437,33 @@ void SemaHLSL::handleShaderAttr(Decl *D, const ParsedAttr
&AL) {
D->addAttr(NewAttr);
}
+void SemaHLSL::handleResourceClassAttr(Decl *D, const ParsedAttr &AL) {
+ if (!AL.isArgIdent(0)) {
+Diag(AL.getLoc(), diag::err_attribute_argument_type)
+
@@ -115,12 +115,19 @@ struct BuiltinTypeDeclBuilder {
return addMemberVariable("h", Ty, Access);
}
- BuiltinTypeDeclBuilder &annotateResourceClass(ResourceClass RC,
-ResourceKind RK, bool IsROV) {
+ BuiltinTypeDeclBuilder
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/98419
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/90553
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -0,0 +1,794 @@
+==
+DXIL Resource Handling
+==
+
+.. contents::
+ :local:
+
+.. toctree::
+ :hidden:
+
+Introduction
+
+
+Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and
+eventually lowered by the Di
@@ -0,0 +1,794 @@
+==
+DXIL Resource Handling
+==
+
+.. contents::
+ :local:
+
+.. toctree::
+ :hidden:
+
+Introduction
+
+
+Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and
+eventually lowered by the Di
@@ -0,0 +1,799 @@
+==
+DXIL Resource Handling
+==
+
+.. contents::
+ :local:
+
+.. toctree::
+ :hidden:
+
+Introduction
+
+
+Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and
+eventually lowered by the Di
https://github.com/bogner ready_for_review
https://github.com/llvm/llvm-project/pull/90553
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -29,6 +29,7 @@ pointer of the template parameter type. The pointer is
populated from a call to
data through until lowering in the backend.
Resource types are annotated with the ``HLSLResource`` attribute, which drives
-code generation for resource binding metadata. The ``h
@@ -0,0 +1,799 @@
+==
+DXIL Resource Handling
+==
+
+.. contents::
+ :local:
+
+.. toctree::
+ :hidden:
+
+Introduction
+
+
+Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and
+eventually lowered by the Di
@@ -0,0 +1,799 @@
+==
+DXIL Resource Handling
+==
+
+.. contents::
+ :local:
+
+.. toctree::
+ :hidden:
+
+Introduction
+
+
+Resources in DXIL are represented via ``TargetExtType`` in LLVM IR and
+eventually lowered by the Di
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/90694
___
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 T(Res.getTargetOpts().Trip
@@ -630,7 +630,7 @@ extern "C" int optMain(
}
}
- Triple ModuleTriple(M->getTargetTriple());
+ Triple ModuleTriple(Triple::normalize(M->getTargetTriple()));
bogner wrote:
Similarly to my concern about updating `createTargetMachineForTriple`, I don't
@@ -744,7 +744,7 @@ void codegen::setFunctionAttributes(StringRef CPU,
StringRef Features,
Expected>
codegen::createTargetMachineForTriple(StringRef TargetTriple,
CodeGenOptLevel OptLevel) {
- Triple TheTriple(TargetTriple);
+ Triple The
@@ -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,
@@ -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/bogner 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
https://github.com/bogner approved this pull request.
Other than [my comment
here](https://github.com/llvm/llvm-project/pull/90809/files#r1589771652) about
what to do in getArchName this looks reasonable.
The string handling in `normalize` feels a bit unwieldy, but I don't have any
obvious th
@@ -744,7 +744,7 @@ void codegen::setFunctionAttributes(StringRef CPU,
StringRef Features,
Expected>
codegen::createTargetMachineForTriple(StringRef TargetTriple,
CodeGenOptLevel OptLevel) {
- Triple TheTriple(TargetTriple);
+ Triple The
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/90276
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bogner wrote:
When reapplying a change that was reverted, please include enough information
in the description so that it can be understood without having to dig up the
old change. Something like:
> [HLSL] reenable add packoffset in AST
>
> This reapplies c5509fedc575 "[HLSL] Support packoffse
bogner 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
> [8522e36](https://github.com/llvm/llvm-project/commit/8522e3609869d72b7b457a4752149a802be4662d)
> of this PR.
https://github.com/bogner approved this pull request.
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/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/91474
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner closed https://github.com/llvm/llvm-project/pull/91500
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
Nathan =?utf-8?q?Gau=C3=ABr?= ,
Nathan =?utf-8?q?Gau=C3=ABr?= ,
Nathan =?utf-8?q?Gau=C3=ABr?= ,
Nathan =?utf-8?q?Gau=C3=ABr?=
Message-ID:
In-Reply-To:
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/88918
https://github.com/bogner edited https://github.com/llvm/llvm-project/pull/92011
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
https://github.com/bogner approved this pull request.
Including clang-tools-extra makes sense to me. Setting up the distribution may
not be as universal but it seems fine too as a default in this cache file.
LGTM
https://github.com/llvm/llvm-project/pull/92011
_
@@ -8,6 +8,12 @@ set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD "DirectX;SPIRV" CACHE
STRING "")
# HLSL support is currently limted to clang, eventually it will expand to
# clang-tools-extra too.
-set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "")
+set(LLVM_ENABLE_PROJECTS "clang;clan
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/92793
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
bogner wrote:
I don't really understand the rationale for this, and it's kind of annoying.
Most of the compiler's flags behave in the "last one wins" fashion (such as
`-O2` and `-O0`) and it's always been convenient to add the flag you want at
the end. Why treat action flags any differently? A
https://github.com/bogner approved this pull request.
https://github.com/llvm/llvm-project/pull/93314
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
@@ -4707,6 +4707,12 @@ def HLSLIsinf : LangBuiltin<"HLSL_LANG"> {
let Prototype = "void(...)";
}
+def HLSLLength : LangBuiltin<"HLSL_LANG"> {
+ let Spellings = ["__builtin_hlsl_elementwise_length"];
bogner wrote:
I think this should be "__builtin_hlsl_leng
@@ -0,0 +1,10 @@
+; RUN: not opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library %s
2>&1 | FileCheck %s
+
+; DXIL operation length does not support double overload type
+; CHECK: LLVM ERROR: Invalid Overload
+
+define noundef double @test_length_double2(<2 x double> nou
@@ -0,0 +1,133 @@
+; RUN: opt -S -dxil-intrinsic-expansion < %s | FileCheck %s
--check-prefixes=CHECK,EXPCHECK
+; RUN: opt -S -dxil-op-lower -mtriple=dxil-pc-shadermodel6.3-library < %s |
FileCheck %s --check-prefixes=CHECK,DOPCHECK
+
+; Make sure dxil operation function call
@@ -157,6 +158,35 @@ static bool expandAnyIntrinsic(CallInst *Orig) {
return true;
}
+static bool expandLengthIntrinsic(CallInst *Orig) {
+ Value *X = Orig->getOperand(0);
+ IRBuilder<> Builder(Orig->getParent());
+ Builder.SetInsertPoint(Orig);
+ Type *Ty = X->getType()
@@ -18460,6 +18460,20 @@ Value *CodeGenFunction::EmitHLSLBuiltinExpr(unsigned
BuiltinID,
/*ReturnType=*/X->getType(), CGM.getHLSLRuntime().getLerpIntrinsic(),
ArrayRef{X, Y, S}, nullptr, "hlsl.lerp");
}
+ case Builtin::BI__builtin_hlsl_elementwise_length: {
401 - 500 of 866 matches
Mail list logo