Cost of spill location is computed basing on relative branch frequency where corresponding spill/reload/copy is located.
While the number itself is highly depends on incoming IR, the total cost can be used when do some changes in RA.
Paths
| Differential D100020
[GreedyRA ORE] Add Cost of spill locations into remark ClosedPublic Authored by skatkov on Apr 6 2021, 10:53 PM.
Details Summary Cost of spill location is computed basing on relative branch frequency where corresponding spill/reload/copy is located. While the number itself is highly depends on incoming IR, the total cost can be used when do some changes in RA.
Diff Detail
Event TimelineHerald added subscribers: dantrushin, hiraditya, qcolombet. · View Herald TranscriptApr 6 2021, 10:53 PM skatkov added a parent revision: D100017: [GreedyRA ORE] Add stats for copy of virtual registers..Apr 6 2021, 10:53 PM Comment Actions LGTM w/required changes.
This revision is now accepted and ready to land.Apr 19 2021, 9:27 AM This revision was landed with ongoing or failed builds.Apr 19 2021, 8:56 PM Closed by commit rG328377307ad2: [GreedyRA ORE] Add Cost of spill locations into remark (authored by skatkov). · Explain Why This revision was automatically updated to reflect the committed changes. skatkov added a reverting change: rG680f3d6de79f: Revert "[GreedyRA ORE] Add Cost of spill locations into remark".Apr 19 2021, 9:09 PM
Revision Contents
Diff 338699 llvm/lib/CodeGen/RegAllocGreedy.cpp
llvm/test/CodeGen/AArch64/arm64-spill-remarks-treshold-hotness.ll
llvm/test/CodeGen/AArch64/arm64-spill-remarks.ll
llvm/test/CodeGen/X86/statepoint-ra.ll
|
Personally, I don't think this function adds any clarity since it's used once, and the naming isn't super obvious. Please just inline this into the caller w/a comment about computing cost.