================
@@ -2364,11 +2364,8 @@ LValue CodeGenFunction::EmitMatrixElementExpr(const 
MatrixElementExpr *E) {
     llvm::Value *Mat = EmitScalarExpr(E->getBase());
     Address MatMem = CreateMemTemp(E->getBase()->getType());
     QualType Ty = E->getBase()->getType();
-    llvm::Type *LTy = convertTypeForLoadStore(Ty, Mat->getType());
-    if (LTy->getScalarSizeInBits() > Mat->getType()->getScalarSizeInBits())
-      Mat = Builder.CreateZExt(Mat, LTy);
-    Builder.CreateStore(Mat, MatMem);
     Base = MakeAddrLValue(MatMem, Ty, AlignmentSource::Decl);
+    EmitStoreOfScalar(Mat, Base, /*isInit=*/true);
----------------
spall wrote:

could we just call EmitStoreOfMatrixScalar here instead to remove a layer of 
indirection? It looks like this code path is guaranteed to call it via 
EmitStoreOfScalar?

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

Reply via email to