A piece of logic in rewriteLoopExitValues has a weird check on number of
users which allowed an unprofitable transform in case if an instruction has
more than 6 users.
Details
Diff Detail
Event Timeline
LGTM
| lib/Transforms/Scalar/IndVarSimplify.cpp | ||
|---|---|---|
| 614–630 | The only suggestion is maybe we could extract this piece of code to a standalone function.  | |
| lib/Transforms/Scalar/IndVarSimplify.cpp | ||
|---|---|---|
| 614–630 | It's done in the follow-up patch https://reviews.llvm.org/D51584. I'm merging them one by one just to make reviewers' life easier. :) | |
| lib/Transforms/Scalar/IndVarSimplify.cpp | ||
|---|---|---|
| 614–630 | Yes there is, https://reviews.llvm.org/D51581 You can use "Stack" tab in Revision Contensts section to see dependencies. :) As for this check, it's removed in the last patch (I really have no idea why it was there). | |
| lib/Transforms/Scalar/IndVarSimplify.cpp | ||
|---|---|---|
| 614–630 | I see | |
The only suggestion is maybe we could extract this piece of code to a standalone function.
This can make the code easier to understand