[clang] [Matrix] Preserve signedness when extending matrix index expression. (PR #103044)
John McCall via cfe-commits
cfe-commits at lists.llvm.org
Fri Aug 16 12:05:20 PDT 2024
================
@@ -4348,8 +4348,18 @@ LValue CodeGenFunction::EmitMatrixSubscriptExpr(const MatrixSubscriptExpr *E) {
!E->isIncomplete() &&
"incomplete matrix subscript expressions should be rejected during Sema");
LValue Base = EmitLValue(E->getBase());
- llvm::Value *RowIdx = EmitScalarExpr(E->getRowIdx());
- llvm::Value *ColIdx = EmitScalarExpr(E->getColumnIdx());
+
+ // Extend or truncate the index type to 32 or 64-bits.
+ auto EmitIndex = [this](const Expr *E) {
----------------
rjmccall wrote:
Yeah, that would be fine.
https://github.com/llvm/llvm-project/pull/103044
More information about the cfe-commits
mailing list