[llvm] r334904 - [NVPTX] Ignore target-cpu and -features for inlining
Jonas Hahnfeld via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 17 02:55:21 PDT 2018
Author: hahnfeld
Date: Sun Jun 17 02:55:20 2018
New Revision: 334904
URL: http://llvm.org/viewvc/llvm-project?rev=334904&view=rev
Log:
[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
Modified:
llvm/trunk/lib/Target/NVPTX/NVPTXTargetTransformInfo.h
Modified: llvm/trunk/lib/Target/NVPTX/NVPTXTargetTransformInfo.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/NVPTX/NVPTXTargetTransformInfo.h?rev=334904&r1=334903&r2=334904&view=diff
==============================================================================
--- llvm/trunk/lib/Target/NVPTX/NVPTXTargetTransformInfo.h (original)
+++ llvm/trunk/lib/Target/NVPTX/NVPTXTargetTransformInfo.h Sun Jun 17 02:55:20 2018
@@ -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; }
More information about the llvm-commits
mailing list