[PATCH] D122259: [SelectOpti][2/5] Select-to-branch base transformation
Sotiris Apostolakis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Mar 25 15:14:36 PDT 2022
apostolakis added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectOptimize.cpp:154
+ // br label %select.end
+ // select.end:
+ // %sel = phi i32 [ %c, %start ], [ %d, %select.false ]
----------------
davidxl wrote:
> Can we have a test case to demonstrate that machine sinking is actually enabled with this transformation?
This patch only includes the base transformation (as depicted in the comments here) without any sinking of eligible instructions to the newly true/false blocks of the new branch. This is why here there isn't even a new true block created and why the tests are simple. The last patch of this series (D120233) optimizes this transformation by aggressively sinking eligible instructions to the newly created true/false blocks and interleaves dependence slices to maximize ILP. In this last patch, you can see the sinking tested with several more complex tests (with the optimized transformation all eligible instructions are sunk). When lowered to assembly these instructions remain sunk. I removed the llc tests that tested assembly code since the opt tests just check the application of this pass without the effects of subsequent codegen passes that could eventually break the tests.
================
Comment at: llvm/lib/CodeGen/SelectOptimize.cpp:229
+ } else {
+ break;
+ }
----------------
davidxl wrote:
> should it skip debug stmts?
Right. If there are debug statements in between select instructions, they should be skipped and not prevent the formation of a select group. Patched the code to address this.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D122259/new/
https://reviews.llvm.org/D122259
More information about the llvm-commits
mailing list