File tree Expand file tree Collapse file tree 4 files changed +240
-420
lines changed
Transforms/CodeGenPrepare Expand file tree Collapse file tree 4 files changed +240
-420
lines changed Original file line number Diff line number Diff line change @@ -2752,7 +2752,7 @@ bool RISCVTargetLowering::isLegalElementTypeForRVV(EVT ScalarTy) const {
27522752 case MVT::i8:
27532753 case MVT::i16:
27542754 case MVT::i32:
2755- return true ;
2755+ return Subtarget.hasVInstructions() ;
27562756 case MVT::i64:
27572757 return Subtarget.hasVInstructionsI64();
27582758 case MVT::f16:
@@ -24820,12 +24820,16 @@ bool RISCVTargetLowering::areTwoSDNodeTargetMMOFlagsMergeable(
2482024820}
2482124821
2482224822bool RISCVTargetLowering::isCtpopFast(EVT VT) const {
24823- if (VT.isScalableVector())
24824- return isTypeLegal(VT) && Subtarget.hasStdExtZvbb();
24825- if (VT.isFixedLengthVector() && Subtarget.hasStdExtZvbb())
24826- return true;
24827- return Subtarget.hasCPOPLike() &&
24828- (VT == MVT::i32 || VT == MVT::i64 || VT.isFixedLengthVector());
24823+ if (VT.isVector()) {
24824+ EVT SVT = VT.getVectorElementType();
24825+ // If the element type is legal we can use cpop.v if it is enabled.
24826+ if (isLegalElementTypeForRVV(SVT))
24827+ return Subtarget.hasStdExtZvbb();
24828+ // Don't consider it fast if the type needs to be legalized or scalarized.
24829+ return false;
24830+ }
24831+
24832+ return Subtarget.hasCPOPLike() && (VT == MVT::i32 || VT == MVT::i64);
2482924833}
2483024834
2483124835unsigned RISCVTargetLowering::getCustomCtpopCost(EVT VT,
You can’t perform that action at this time.
0 commit comments