[PATCH] D47691: [NVPTX] Ignore target-cpu and -features for inling
Jonas Hahnfeld via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 3 12:15:09 PDT 2018
Hahnfeld created this revision.
Hahnfeld added reviewers: tra, jlebar.
Herald added subscribers: llvm-commits, jholewinski.
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.
Repository:
rL LLVM
https://reviews.llvm.org/D47691
Files:
lib/Target/NVPTX/NVPTXTargetTransformInfo.h
Index: lib/Target/NVPTX/NVPTXTargetTransformInfo.h
===================================================================
--- lib/Target/NVPTX/NVPTXTargetTransformInfo.h
+++ lib/Target/NVPTX/NVPTXTargetTransformInfo.h
@@ -61,6 +61,14 @@
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; }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47691.149655.patch
Type: text/x-patch
Size: 919 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180603/e54e124c/attachment.bin>
More information about the llvm-commits
mailing list