[clang] [CIR][NFC] Add missing checks in emitForMemory (PR #194646)
via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 28 07:49:06 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-clang
Author: Sirui Mu (Lancern)
<details>
<summary>Changes</summary>
As mentioned at https://github.com/llvm/llvm-project/pull/194239#discussion_r3149409711 :
> Not related to your PR, but it looks like we're missing checks here for bool vectors and BitInt destination types.
This patch adds the missing checks for bool vectors and BitInt types in the `ConstantEmitter::emitForMemory` function.
---
Full diff: https://github.com/llvm/llvm-project/pull/194646.diff
1 Files Affected:
- (modified) clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp (+10)
``````````diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp b/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
index 490703d9b5052..855b64947a237 100644
--- a/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenExprConstant.cpp
@@ -1764,6 +1764,16 @@ mlir::Attribute ConstantEmitter::emitForMemory(CIRGenModule &cgm,
cgm.errorNYI("emitForMemory: tail padding in atomic initializer");
}
+ // In HLSL bool vectors are stored in memory as a vector of i32
+ if (destType->isExtVectorBoolType() &&
+ !destType->isPackedVectorBoolType(cgm.getASTContext())) {
+ cgm.errorNYI("emitForMemory: zero-extend HLSL bool vectors");
+ }
+
+ if (destType->isBitIntType()) {
+ cgm.errorNYI("emitForMemory: _BitInt type");
+ }
+
return c;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/194646
More information about the cfe-commits
mailing list