-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
Apple platforms: Disabled frame pointer elimination causes perf issues and is not in line with what clang does #86196
Copy link
Copy link
Closed
Labels
A-codegenArea: Code generationArea: Code generationC-bugCategory: This is a bug.Category: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.O-iosOperating system: iOSOperating system: iOSO-macosOperating system: macOSOperating system: macOSP-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Milestone
Metadata
Metadata
Assignees
Labels
A-codegenArea: Code generationArea: Code generationC-bugCategory: This is a bug.Category: This is a bug.I-slowIssue: Problems and improvements with respect to performance of generated code.Issue: Problems and improvements with respect to performance of generated code.O-iosOperating system: iOSOperating system: iOSO-macosOperating system: macOSOperating system: macOSP-highHigh priorityHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.Performance or correctness regression from stable to nightly.
Type
Fields
Give feedbackNo fields configured for issues without a type.
PR #85706 causes
massiveperformance issues for not-inlined leaf functions since the frame pointer and the link register are now always saved and restored at the beginning and end of a function, even if this function e.g. just returns a constant. In contrast to the PR description this is not what clang does on Macos aarch64. The clang default on Macos is"frame-pointer"="non-leaf"instead.E.g. clang compiles
to this LLVM IR (with
clang -c test.c -S -emit-llvm -O3)which leads to this assembly:
Since the inclusion of the PR Rust Nightly sets
"frame-pointer"="all", which causes this assembly to be generated:@jrmuizel: FYI