Skip to content
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

[FMV][GlobalOpt] Do not statically resolve non-FMV callers. #123383

Merged
merged 2 commits into from
Jan 17, 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
12 changes: 10 additions & 2 deletions llvm/lib/Transforms/IPO/GlobalOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2785,8 +2785,16 @@ static bool OptimizeNonTrivialIFuncs(
} else {
// We can't reason much about non-FMV callers. Just pick the highest
// priority callee if it matches, otherwise bail.
if (I > 0 || !implies(CallerBits, CalleeBits))
continue;
// if (I > 0 || !implies(CallerBits, CalleeBits))
//
// FIXME: This is causing a regression in the llvm test suite,
// specifically a 'predres' version is unexpectedly trapping on
// GravitonG4. My explanation is that when the caller in not a
// versioned function, the compiler exclusively relies on the
// command line option, or target attribute to deduce whether a
// feature is available. However, there is no guarantee that in
// reality the host supports those implied features.
continue;
}
auto &Calls = CallSites[Caller];
for (CallBase *CS : Calls)
Expand Down
2 changes: 1 addition & 1 deletion llvm/test/Transforms/GlobalOpt/resolve-fmv-ifunc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ resolver_entry:
define i32 @caller4() #8 {
; CHECK-LABEL: define i32 @caller4(
; CHECK-SAME: ) local_unnamed_addr #[[ATTR7:[0-9]+]] {
; CHECK: [[CALL:%.*]] = tail call i32 @test_non_fmv_caller._Maes()
; CHECK: [[CALL:%.*]] = tail call i32 @test_non_fmv_caller()
;
entry:
%call = tail call i32 @test_non_fmv_caller()
Expand Down
Loading