If the loop limit is not invariant don't directly bail out, but try to make it invariant with makeLoopInvariant.
I precommitted the test case for this in rG20c7ab87a78c.
Details
Diff Detail
Event Timeline
llvm/test/Transforms/LoopFlatten/limit-not-invariant.ll | ||
---|---|---|
14 | Well spotted. This patch was part of my grand master plan to support different phi types, and this patch was to get the first little obstacle out of the way. But because of changes in D88880, the input IR and test case might not be so relevant anymore, so I will look at that first now because I still think this is little change is useful. |
(marking as changes requested to clear up review queue as there are outstanding comments)
llvm/lib/Transforms/Scalar/LoopFlatten.cpp | ||
---|---|---|
431 | Update the comment saying we try to make it invariant? | |
432 | does this need to be initialized? I think there might be some code paths in makeLoopInvariant that do not set Changed. |
Update the comment saying we try to make it invariant?