================
@@ -1189,9 +1189,15 @@ LValue CIRGenFunction::emitExtVectorElementExpr(const 
ExtVectorElementExpr *e) {
     base = emitLValue(e->getBase());
   } else {
     // Otherwise, the base is a normal rvalue (as in (V+V).x), emit it as such.
-    cgm.errorNYI(e->getSourceRange(),
-                 "emitExtVectorElementExpr: base is a normal rvalue");
-    return {};
+    assert(e->getBase()->getType()->isVectorType() &&
+           "Result must be a vector");
+    mlir::Value vec = emitScalarExpr(e->getBase());
+
+    // Store the vector to memory (because LValue wants an address).
+    QualType baseTy = e->getBase()->getType();
+    Address vecMem = createMemTemp(baseTy, vec.getLoc(), "tmp");
+    builder.createStore(vec.getLoc(), vec, vecMem);
----------------
bcardosolopes wrote:

> I added NYI because the Vector of bool is not supported yet

I guess what we need here is to substitute the NYI skeleton for checking on 
`isPackedVectorBoolType` in place of `isExtVectorBoolType`, but if that needs 
more work I'm fine if that comes as a next PR.

https://github.com/llvm/llvm-project/pull/168260
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to