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 {
2752
2752
case MVT::i8:
2753
2753
case MVT::i16:
2754
2754
case MVT::i32:
2755
- return true ;
2755
+ return Subtarget.hasVInstructions() ;
2756
2756
case MVT::i64:
2757
2757
return Subtarget.hasVInstructionsI64();
2758
2758
case MVT::f16:
@@ -24820,12 +24820,16 @@ bool RISCVTargetLowering::areTwoSDNodeTargetMMOFlagsMergeable(
24820
24820
}
24821
24821
24822
24822
bool 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);
24829
24833
}
24830
24834
24831
24835
unsigned RISCVTargetLowering::getCustomCtpopCost(EVT VT,
You can’t perform that action at this time.
0 commit comments