@@ -766,20 +766,20 @@ class ScalarExprEmitter
766766 CodeGenFunction::CGFPOptionsRAII FPOptsRAII (CGF, Ops.FPFeatures );
767767 if (LHSMatTy && RHSMatTy) {
768768 // Note that SME only has non-widening MOPA for float32 and float64, so
769- // only these two types have native SME matmul operations. For other
770- // types, SVE version is used. We hope that SVE version is better than
771- // default NEON or scalar version.
772- auto Ty = LHSMatTy->getElementType ();
773- if (!CGF.getContext ().getTargetInfo ().hasFeature (" sme" ) ||
774- !MatrixType::isValidTypeForSME (Ty))
769+ // only these two types have native SME matmul operations. For other
770+ // types, SVE version is used. We hope that SVE version is better than
771+ // default NEON or scalar version.
772+ auto Ty = LHSMatTy->getElementType ();
773+ if (!CGF.getContext ().getTargetInfo ().hasFeature (" sme" ) ||
774+ !MatrixType::isValidTypeForSME (Ty))
775775 return MB.CreateMatrixMultiply (
776- Ops.LHS , Ops.RHS , LHSMatTy->getNumRows (),
777- LHSMatTy->getNumColumns (), RHSMatTy->getNumColumns ());
776+ Ops.LHS , Ops.RHS , LHSMatTy->getNumRows (),
777+ LHSMatTy->getNumColumns (), RHSMatTy->getNumColumns ());
778778 assert (isa<BuiltinType>(Ty) && " SME types should be BuiltinType." );
779779 return MB.CreateSMEMatrixMultiply (
780- Ops.LHS , Ops.RHS , LHSMatTy->getNumRows (), LHSMatTy->getNumColumns (),
780+ Ops.LHS , Ops.RHS , LHSMatTy->getNumRows (), LHSMatTy->getNumColumns (),
781781 RHSMatTy->getNumColumns (),
782- cast<BuiltinType>(Ty)->isSignedInteger ());
782+ cast<BuiltinType>(Ty)->isSignedInteger ());
783783 }
784784 return MB.CreateScalarMultiply (Ops.LHS , Ops.RHS );
785785 }
@@ -4192,7 +4192,7 @@ Value *ScalarExprEmitter::EmitAdd(const BinOpInfo &op) {
41924192 assert (isa<BuiltinType>(Ty) && " SME types should be BuiltinType." );
41934193 return MB.CreateSMEMatrixBinOp (
41944194 op.LHS , op.RHS , MatTy->getNumRows (), MatTy->getNumColumns (),
4195- cast<BuiltinType>(Ty)->isSignedInteger (), " add" );
4195+ cast<BuiltinType>(Ty)->isSignedInteger (), " add" );
41964196 }
41974197
41984198 if (op.Ty ->isUnsignedIntegerType () &&
@@ -4349,14 +4349,14 @@ Value *ScalarExprEmitter::EmitSub(const BinOpInfo &op) {
43494349 llvm::MatrixBuilder MB (Builder);
43504350 CodeGenFunction::CGFPOptionsRAII FPOptsRAII (CGF, op.FPFeatures );
43514351 auto *MatTy =
4352- cast<ConstantMatrixType>(op.E ->getType ().getCanonicalType ());
4352+ cast<ConstantMatrixType>(op.E ->getType ().getCanonicalType ());
43534353 auto Ty = MatTy->getElementType ();
43544354 if (!CGF.getContext ().getTargetInfo ().hasFeature (" sme" ) ||
43554355 !MatrixType::isValidTypeForSME (Ty))
4356- return MB.CreateSub (op.LHS , op.RHS );
4356+ return MB.CreateSub (op.LHS , op.RHS );
43574357 assert (isa<BuiltinType>(Ty) && " SME types should be BuiltinType." );
43584358 return MB.CreateSMEMatrixBinOp (
4359- op.LHS , op.RHS , MatTy->getNumRows (), MatTy->getNumColumns (),
4359+ op.LHS , op.RHS , MatTy->getNumRows (), MatTy->getNumColumns (),
43604360 cast<BuiltinType>(Ty)->isSignedInteger (), " sub" );
43614361 }
43624362
0 commit comments