================
@@ -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);
----------------
andykaylor wrote:
Classic codegen has some recently added code here to handle a vector of bools
by zero-extending. See https://github.com/llvm/llvm-project/pull/123977
We should update this to handle that case.
https://github.com/llvm/llvm-project/pull/168260
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits