[clang] [CIR] Implement HLSL vector element lvalue scalar swizzles (PR #238425)

Benjamin Maxwell via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 4 23:47:51 PST 2026


================
@@ -883,8 +862,11 @@ RValue CIRGenFunction::emitLoadOfExtVectorElementLValue(LValue lv) {
   // IR value to a vector here allows the rest of codegen to behave as normal.
   if (getLangOpts().HLSL &&
       !mlir::isa<cir::VectorType, cir::MatrixType>(vec.getType())) {
-    cgm.errorNYI(loc, "emitLoadOfExtVectorElementLValue: HLSL");
-    return {};
+    auto dstTy = cir::VectorType::get(
+        vec.getType(), llvm::ElementCount::get(1, /*Scalable=*/false));
----------------
MacDue wrote:

This should just be 
```suggestion
    auto dstTy = cir::VectorType::getFixed(
        vec.getType(), 1);
```


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


More information about the cfe-commits mailing list