[llvm-branch-commits] [clang] [clang][bytecode][HLSL][Matrix] Support `ConstantMatrixType` and more HLSL casts in the new constant interpreter for basic matrix constexpr evaluation in HLSL (PR #183424)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Feb 25 16:56:59 PST 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h -- clang/lib/AST/ByteCode/Compiler.cpp clang/lib/AST/ByteCode/Compiler.h clang/lib/AST/ByteCode/Pointer.cpp clang/lib/AST/ByteCode/Program.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/AST/ByteCode/Compiler.cpp b/clang/lib/AST/ByteCode/Compiler.cpp
index 87982e67d..6f5ed3b7d 100644
--- a/clang/lib/AST/ByteCode/Compiler.cpp
+++ b/clang/lib/AST/ByteCode/Compiler.cpp
@@ -864,8 +864,7 @@ bool Compiler<Emitter>::VisitCastExpr(const CastExpr *CE) {
if (const auto *VT = CE->getType()->getAs<VectorType>()) {
NumElts = VT->getNumElements();
DestElemType = VT->getElementType();
- } else if (const auto *MT =
- CE->getType()->getAs<ConstantMatrixType>()) {
+ } else if (const auto *MT = CE->getType()->getAs<ConstantMatrixType>()) {
NumElts = MT->getNumElementsFlattened();
DestElemType = MT->getElementType();
} else {
diff --git a/clang/lib/AST/ByteCode/Program.cpp b/clang/lib/AST/ByteCode/Program.cpp
index 8876ded40..a2cba3da2 100644
--- a/clang/lib/AST/ByteCode/Program.cpp
+++ b/clang/lib/AST/ByteCode/Program.cpp
@@ -480,9 +480,8 @@ Descriptor *Program::createDescriptor(const DeclTy &D, const Type *Ty,
if (!ElemTy)
return nullptr;
- return allocateDescriptor(D, *ElemTy, MDSize,
- MT->getNumElementsFlattened(), IsConst,
- IsTemporary, IsMutable);
+ return allocateDescriptor(D, *ElemTy, MDSize, MT->getNumElementsFlattened(),
+ IsConst, IsTemporary, IsMutable);
}
return nullptr;
``````````
</details>
https://github.com/llvm/llvm-project/pull/183424
More information about the llvm-branch-commits
mailing list