[PATCH] D129072: [RISCV] Fix the scale of getIntMatCost and also need adjust for getIntImmCost
Zixuan Wu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 4 18:51:48 PDT 2022
zixuan-wu added a comment.
In D129072#3629019 <https://reviews.llvm.org/D129072#3629019>, @liaolucy wrote:
> I would like to ask a question, is this patch to reduce code size?
I think the instruction cost model can be used both in code size and performance. Normally it's in TCK_SizeAndLatency kind.
================
Comment at: llvm/lib/Target/RISCV/MCTargetDesc/RISCVMatInt.cpp:384
bool IsRV64 = ActiveFeatures[RISCV::Feature64Bit];
bool HasRVC = CompressionCost && ActiveFeatures[RISCV::FeatureStdExtC];
int PlatRegSize = IsRV64 ? 64 : 32;
----------------
craig.topper wrote:
> HasRVC also considers ‘CompressionCost’ so it only scaled the value when that was passed. TargetTransformInfo doesn’t set that flag.
I think it's better to use same multiplicative factor in one cost function, no matter the RVC is enable or not.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D129072/new/
https://reviews.llvm.org/D129072
More information about the llvm-commits
mailing list