Skip to content

Commit 572d25b

Browse files
committed
[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
1 parent 011c97e commit 572d25b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Target/NVPTX/NVPTXTargetTransformInfo.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,14 @@ class NVPTXTTIImpl : public BasicTTIImplBase<NVPTXTTIImpl> {
6161
unsigned getRegisterBitWidth(bool Vector) const { return 32; }
6262
unsigned getMinVectorRegisterBitWidth() const { return 32; }
6363

64+
// We don't want to prevent inlining because of target-cpu and -features
65+
// attributes that were added to newer versions of LLVM/Clang: There are
66+
// no incompatible functions in PTX, ptxas will throw errors in such cases.
67+
bool areInlineCompatible(const Function *Caller,
68+
const Function *Callee) const {
69+
return true;
70+
}
71+
6472
// Increase the inlining cost threshold by a factor of 5, reflecting that
6573
// calls are particularly expensive in NVPTX.
6674
unsigned getInliningThresholdMultiplier() { return 5; }

0 commit comments

Comments
 (0)