From: Jonas Hahnfeld Date: Sun, 17 Jun 2018 09:55:20 +0000 (+0000) Subject: [NVPTX] Ignore target-cpu and -features for inlining X-Git-Tag: android-x86-8.1-r1~2021 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=572d25bd9ae2ea830f09e7469a509b018c7fe205;p=android-x86%2Fexternal-llvm.git [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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334904 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/NVPTX/NVPTXTargetTransformInfo.h b/lib/Target/NVPTX/NVPTXTargetTransformInfo.h index 812d305da18..a631055d36a 100644 --- a/lib/Target/NVPTX/NVPTXTargetTransformInfo.h +++ b/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; }