[PATCH] D125665: [ARM] Cost modelling for scalar fptoi_sat
Sjoerd Meijer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue May 17 00:38:26 PDT 2022
SjoerdMeijer accepted this revision.
SjoerdMeijer added a comment.
This revision is now accepted and ready to land.
LGTM
================
Comment at: llvm/lib/Target/ARM/ARMTargetTransformInfo.cpp:1776
+ // Check for the legal types, with the corect subtarget features.
+ if ((ST->hasVFP2Base() && LT.second == MVT::f32 && MTy == MVT::i32) ||
+ (ST->hasFP64() && LT.second == MVT::f64 && MTy == MVT::i32) ||
----------------
Nit: this if and the one below could share some code. I think this a small improvement, but I don't mind either way:
if (((ST->hasVFP2Base() && LT.second == MVT::f32) ||
(ST->hasFP64() && LT.second == MVT::f64) ||
(ST->hasFullFP16() && LT.second == MVT::f16)) {
if (MTy == MVT::i32)
return LT.first;
if (LT.second.getScalarSizeInBits() < MTy.getScalarSizeInBits())
break;
Type *LegalTy = Type::getIntNTy(ICA.getReturnType()->getContext(),
LT.second.getScalarSizeInBits());
InstructionCost Cost = 1;
..
}
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D125665/new/
https://reviews.llvm.org/D125665
More information about the llvm-commits
mailing list