This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Implement '--assume-abi' option for AArch64
ClosedPublic

Authored by Kepontry on Sep 21 2023, 2:03 AM.

Details

Summary

[BOLT] Implement '--assume-abi' option for AArch64

This patch implements the getCalleeSavedRegs function for AArch64,
addressing the issue where the "not implemented" error occurs when
both the --assume-abi option and options related to the
RegAnalysis Pass (e.g., --indirect-call-promotion=all) are enabled.

The beConservative function is utilized to determine the set of
used registers in cases where we have no prior information about
the function. When the --assume-abi option is enabled,
callee-saved registers should not be included in this set.

Diff Detail

Event Timeline

Kepontry created this revision.Sep 21 2023, 2:03 AM
Kepontry requested review of this revision.Sep 21 2023, 2:03 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2023, 2:03 AM

Hello! Please provide the test for this change.

Kepontry updated this revision to Diff 557279.Sep 24 2023, 2:38 AM

Add a simple testcase.

yota9 added inline comments.Sep 24 2023, 4:22 AM
bolt/lib/Target/AArch64/AArch64MCPlusBuilder.cpp
447

I believe we must add X18 register also, since the ARM ABI says it might be platform-specific, so BOLT must preserve it's value

Kepontry updated this revision to Diff 557282.Sep 24 2023, 5:47 AM
yota9 accepted this revision.Sep 24 2023, 5:49 AM
This revision is now accepted and ready to land.Sep 24 2023, 5:49 AM