This patch adds the loop-level heuristics for determining whether branches are more profitable than conditional moves.
These heuristics apply to only inner-most loops.
Depends on D120231
Paths
| Differential D120232
[SelectOpti][4/5] Loop Heuristics ClosedPublic Authored by apostolakis on Feb 20 2022, 10:49 PM.
Details
Summary This patch adds the loop-level heuristics for determining whether branches are more profitable than conditional moves. Depends on D120231
Diff Detail
Event Timelineapostolakis added a child revision: D120233: [SelectOpti][5/5] Optimize select-to-branch transformation.Feb 20 2022, 10:54 PM apostolakis retitled this revision from [SelectOpti][3/4] Loop Heuristics to [SelectOpti][4/5] Loop Heuristics.Mar 22 2022, 2:33 PM Comment Actions A high level comment. I saw ScalingUpFactor is used in many places. It may be better to directly use Scaled64 data type instead of uint64 to avoid that. Comment Actions
I used ScalingUpFactor to get a decent precision without increasing compile time (due to non-integer ops), but it is a bit hacky and it seems better to directly use Scaled64.
This revision is now accepted and ready to land.May 5 2022, 1:48 PM This revision was landed with ongoing or failed builds.May 23 2022, 8:03 PM Closed by commit rGd7ebb7461151: [SelectOpti][4/5] Loop Heuristics (authored by apostolakis). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 426580 llvm/lib/CodeGen/SelectOptimize.cpp
llvm/test/CodeGen/X86/select-optimize.ll
|
Not clear about what the second condition actually means. What is the cost of select group?