Skip to content

Commit 9eb4ea6

Browse files
committed
only inline when featurebits are equal
1 parent f18941c commit 9eb4ea6

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,9 +431,8 @@ bool SystemZTTIImpl::areInlineCompatible(const Function *Caller,
431431
const FeatureBitset &CalleeBits =
432432
TM.getSubtargetImpl(*Callee)->getFeatureBits();
433433

434-
// Check that target features from the callee are subset or
435-
// equal to the caller's features.
436-
return (CalleeBits == CallerBits) || (CalleeBits < CallerBits);
434+
// Check that target features from the callee are equal to the caller's features.
435+
return CallerBits == CalleeBits;
437436
}
438437

439438
unsigned SystemZTTIImpl::getNumberOfRegisters(unsigned ClassID) const {

llvm/test/Transforms/Inline/SystemZ/inline-target-attr.ll

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
; RUN: opt < %s -mtriple=s390x-linux-gnu -S -passes=inline | FileCheck %s
22
; RUN: opt < %s -mtriple=s390x-linux-gnu -S -passes='cgscc(inline)' | FileCheck %s
3-
; Check that we only inline when we have compatible target attributes.
3+
; Check that we only inline when we have equal target attributes.
44

55
define i32 @foo() #0 {
66
entry:
@@ -17,31 +17,23 @@ entry:
1717
%call = call i32 @foo()
1818
ret i32 %call
1919
; CHECK-LABEL: bar
20-
; CHECK: call i32 (...) @baz()
20+
; CHECK: call i32 @foo()
2121
}
2222

2323
define i32 @qux() #0 {
2424
entry:
25-
%call = call i32 @bar()
25+
%call = call i32 @foo()
2626
ret i32 %call
2727
; CHECK-LABEL: qux
28-
; CHECK: call i32 @bar()
28+
; CHECK: call i32 (...) @baz()
2929
}
3030

3131
define i32 @quux() #2 {
3232
entry:
3333
%call = call i32 @bar()
3434
ret i32 %call
3535
; CHECK-LABEL: quux
36-
; CHECK: call i32 (...) @baz()
37-
}
38-
39-
define i32 @foobar() #1 {
40-
entry:
41-
%call = call i32 @bar()
42-
ret i32 %call
43-
; CHECK-LABEL: foobar
44-
; CHECK: call i32 (...) @baz()
36+
; CHECK: call i32 @bar()
4537
}
4638

4739

0 commit comments

Comments
 (0)