OSDN Git Service

[NVPTX] Ignore target-cpu and -features for inlining
authorJonas Hahnfeld <hahnjo@hahnjo.de>
Sun, 17 Jun 2018 09:55:20 +0000 (09:55 +0000)
committerJonas Hahnfeld <hahnjo@hahnjo.de>
Sun, 17 Jun 2018 09:55:20 +0000 (09:55 +0000)
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

lib/Target/NVPTX/NVPTXTargetTransformInfo.h

index 812d305..a631055 100644 (file)
@@ -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; }