Skip to content

release/21.x: [SystemZ] Remove incorrect areInlineCompatible hook (#152494) #152660

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -436,20 +436,6 @@ bool SystemZTTIImpl::isLSRCostLess(
C2.ScaleCost, C2.SetupCost);
}

bool SystemZTTIImpl::areInlineCompatible(const Function *Caller,
const Function *Callee) const {
const TargetMachine &TM = getTLI()->getTargetMachine();

const FeatureBitset &CallerBits =
TM.getSubtargetImpl(*Caller)->getFeatureBits();
const FeatureBitset &CalleeBits =
TM.getSubtargetImpl(*Callee)->getFeatureBits();

// Support only equal feature bitsets. Restriction should be relaxed in the
// future to allow inlining when callee's bits are subset of the caller's.
return CallerBits == CalleeBits;
}

unsigned SystemZTTIImpl::getNumberOfRegisters(unsigned ClassID) const {
bool Vector = (ClassID == 1);
if (!Vector)
Expand Down
3 changes: 0 additions & 3 deletions llvm/lib/Target/SystemZ/SystemZTargetTransformInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,6 @@ class SystemZTTIImpl final : public BasicTTIImplBase<SystemZTTIImpl> {
bool isLSRCostLess(const TargetTransformInfo::LSRCost &C1,
const TargetTransformInfo::LSRCost &C2) const override;

bool areInlineCompatible(const Function *Caller,
const Function *Callee) const override;

/// @}

/// \name Vector TTI Implementations
Expand Down
18 changes: 9 additions & 9 deletions llvm/test/Transforms/Inline/SystemZ/inline-target-attr.ll
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,28 @@ entry:

declare i32 @baz(...) #0

define i32 @bar() #1 {
define i32 @features_subset() #1 {
entry:
%call = call i32 @foo()
ret i32 %call
; CHECK-LABEL: bar
; CHECK: call i32 @foo()
; CHECK-LABEL: features_subset
; CHECK: call i32 (...) @baz()
}

define i32 @qux() #0 {
define i32 @features_equal() #0 {
entry:
%call = call i32 @foo()
ret i32 %call
; CHECK-LABEL: qux
; CHECK-LABEL: features_equal
; CHECK: call i32 (...) @baz()
}

define i32 @quux() #2 {
define i32 @features_different() #2 {
entry:
%call = call i32 @bar()
%call = call i32 @foo()
ret i32 %call
; CHECK-LABEL: quux
; CHECK: call i32 @bar()
; CHECK-LABEL: features_different
; CHECK: call i32 @foo()
}


Expand Down
Loading