[NVPTX] Ignore target-cpu and -features for inlining

We don't want to prevent inlining because of target-cpu and -features
attributes that were added to newer versions of LLVM/Clang: There are
no incompatible functions in PTX, ptxas will throw errors in such cases.

Differential Revision: https://reviews.llvm.org/D47691

llvm-svn: 334904
This commit is contained in:
Jonas Hahnfeld 2018-06-17 09:55:20 +00:00
parent 71befacd6c
commit c7410ed47a
1 changed files with 8 additions and 0 deletions

View File

@ -61,6 +61,14 @@ public:
unsigned getRegisterBitWidth(bool Vector) const { return 32; } unsigned getRegisterBitWidth(bool Vector) const { return 32; }
unsigned getMinVectorRegisterBitWidth() const { return 32; } unsigned getMinVectorRegisterBitWidth() const { return 32; }
// We don't want to prevent inlining because of target-cpu and -features
// attributes that were added to newer versions of LLVM/Clang: There are
// no incompatible functions in PTX, ptxas will throw errors in such cases.
bool areInlineCompatible(const Function *Caller,
const Function *Callee) const {
return true;
}
// Increase the inlining cost threshold by a factor of 5, reflecting that // Increase the inlining cost threshold by a factor of 5, reflecting that
// calls are particularly expensive in NVPTX. // calls are particularly expensive in NVPTX.
unsigned getInliningThresholdMultiplier() { return 5; } unsigned getInliningThresholdMultiplier() { return 5; }