diff options
author | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2018-06-17 09:55:20 +0000 |
---|---|---|
committer | Jonas Hahnfeld <hahnjo@hahnjo.de> | 2018-06-17 09:55:20 +0000 |
commit | a795ba49d3341135ac923c4c0b3b1378e4357cbd (patch) | |
tree | 7230af8e187cf35f091e1fb59b1b9b8d25a0cced /llvm/lib/Target/NVPTX | |
parent | 4272f6f62c6298e364c7920e6d580c69f67cf973 (diff) |
[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
Diffstat (limited to 'llvm/lib/Target/NVPTX')
-rw-r--r-- | llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h index 812d305da18..a631055d36a 100644 --- a/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h +++ b/llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.h @@ -61,6 +61,14 @@ public: unsigned getRegisterBitWidth(bool Vector) 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 // calls are particularly expensive in NVPTX. unsigned getInliningThresholdMultiplier() { return 5; } |