In LoopUnswitch when replacing a branch Parent -> Succ with a conditional
branch Parent -> True & Parent->False, the DomTree updates should insert an edge for
each of True/False if True/False are different than Succ, and delete Parent->Succ edge
if both are different. The comparison with Succ appears to be incorect,
it's comparing with Parent instead.
There is no test failing either before or after this change, but it seems to me this is
the right way to do the update.
Details
Diff Detail
- Repository
- rL LLVM
- Build Status
Buildable 19600 Build 19600: arc lint + arc unit
Event Timeline
lib/Transforms/Scalar/LoopUnswitch.cpp | ||
---|---|---|
945 | I'm not sure we can get that info in this method. This is essentially an util, independent of the loopunswitch logic at the callsite. | |
947 | This should not be possible. |
LGTM
lib/Transforms/Scalar/LoopUnswitch.cpp | ||
---|---|---|
947 | I think it would make it clear for whoever tries to figure out the correct logic here later. |
It'd be nice to get a test case here, but if its not feasible, the change is obviously correct (or at least an improvement!!!)
LGTM.
If it's illegal to loop back to preheader, maybe there should be an assert for that?