[clang] [HLSL] Update indexed vector elements individually (PR #169144)

Justin Bogner via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 24 15:50:56 PST 2025


================
@@ -2575,6 +2575,30 @@ void CodeGenFunction::EmitStoreThroughLValue(RValue Src, LValue Dst,
                                              bool isInit) {
   if (!Dst.isSimple()) {
     if (Dst.isVectorElt()) {
+      if (getLangOpts().HLSL) {
+        // In HLSL, storing to individual elements of a vector through
----------------
bogner wrote:

While it's true that HLSL doesn't really allow anything problematic, it might be worth an `assert` that `ElemTy->getScalarSizeInBits()` is at least byte sized in case something in the language changes down the road.

https://github.com/llvm/llvm-project/pull/169144


More information about the cfe-commits mailing list