================
@@ -322,13 +322,19 @@ class ScalarExprEmitter : public
StmtVisitor<ScalarExprEmitter, mlir::Value> {
mlir::Location loc = cgf.getLoc(e->getSourceRange());
if (cgf.cgm.getCodeGenOpts().OptimizationLevel > 0)
assert(!cir::MissingFeatures::emitMatrixIndexAssumption());
- return builder.createMatrixExtract(loc, matrix, rowIdx, columnIdx);
+ mlir::Type resultTy = convertType(e->getType());
+ return builder.createMatrixExtract(loc, resultTy, matrix, rowIdx,
+ columnIdx);
}
mlir::Value VisitMatrixSingleSubscriptExpr(MatrixSingleSubscriptExpr *e) {
- cgf.cgm.errorNYI(e->getSourceRange(),
- "ScalarExprEmitter: matrix singel subscript");
- return {};
+ mlir::Value rowIdx = cgf.emitScalarExpr(e->getRowIdx());
+ if (cgf.cgm.getCodeGenOpts().OptimizationLevel > 0)
+ assert(!cir::MissingFeatures::emitMatrixIndexAssumption());
----------------
erichkeane wrote:
This wont work in non-asserts build, as the 'if' will 'eat' the matrix
definition next, since the assert wont exist.I see the above 324 screwed this
up as well!
https://github.com/llvm/llvm-project/pull/232079
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits