================
@@ -320,9 +320,11 @@ class ScalarExprEmitter : public
StmtVisitor<ScalarExprEmitter, mlir::Value> {
}
mlir::Value VisitMatrixSubscriptExpr(MatrixSubscriptExpr *e) {
- cgf.cgm.errorNYI(e->getSourceRange(),
- "ScalarExprEmitter: matrix subscript");
- return {};
+ mlir::Value matrix = Visit(e->getBase());
+ mlir::Value rowIdx = cgf.emitMatrixIndexExpr(e->getRowIdx());
+ mlir::Value columnIdx = cgf.emitMatrixIndexExpr(e->getColumnIdx());
+ mlir::Location loc = cgf.getLoc(e->getSourceRange());
+ return builder.createMatrixExtract(loc, matrix, rowIdx, columnIdx);
----------------
AmrDeveloper wrote:
Mmmmm, I can do that, but then I will move the casting index size to the
lowering part
https://github.com/llvm/llvm-project/pull/229879
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits