-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[TTI] Check type legalization of both src and result for fpto{u|s}i.sat. #147657
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
9253fc6
6b8397d
31815b2
0972f9c
23990c0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2486,11 +2486,18 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase<T> { | |
ISD = ISD::UMULO; | ||
break; | ||
case Intrinsic::fptosi_sat: | ||
ISD = ISD::FP_TO_SINT_SAT; | ||
break; | ||
case Intrinsic::fptoui_sat: | ||
ISD = ISD::FP_TO_UINT_SAT; | ||
case Intrinsic::fptoui_sat: { | ||
std::pair<InstructionCost, MVT> SrcLT = getTypeLegalizationCost(Tys[0]); | ||
std::pair<InstructionCost, MVT> RetLT = getTypeLegalizationCost(RetTy); | ||
|
||
// For cast instructions, types are differnt between source and | ||
// destination. Also need to check if the source type can be legalize. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this, any type should be legalizable. Why would this ever return an invalid cost? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some of the vector type might not be legalize if the target not support. For example, |
||
if (!SrcLT.first.isValid() || !RetLT.first.isValid()) | ||
return InstructionCost::getInvalid(); | ||
ISD = IID == Intrinsic::fptosi_sat ? ISD::FP_TO_SINT_SAT | ||
: ISD::FP_TO_UINT_SAT; | ||
break; | ||
} | ||
case Intrinsic::ctpop: | ||
ISD = ISD::CTPOP; | ||
// In case of legalization use TCC_Expensive. This is cheaper than a | ||
|
Uh oh!
There was an error while loading. Please reload this page.