[PATCH] D47647: [PM/LoopUnswitch] Fix how the cloned loops are handled when updating analyses.

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 1 12:00:10 PDT 2018


chandlerc created this revision.
chandlerc added reviewers: asbirlea, sanjoy.
Herald added subscribers: hiraditya, mcrosier.

I noticed this issue because we didn't put the primary cloned loop into
the `NonChildClonedLoops` vector and so never iterated on it. Once
I fixed that, it made it clear why I had to do a really complicated and
unnecesasry dance when updating the loops to remain in canonical form --
I was unwittingly working around the fact that the primary cloned loop
wasn't in the expected list of cloned loops. Doh!

Now that we include it in this vector, we don't need to return it and we
can consolidate the update logic as we correctly have a single place
where it can be handled.

I've just added a test for the iteration order aspect as every time
I changed the update logic partially or incorrectly here, an existing
test failed and caught it so that seems well covered (which is also
evidenced by the extensive working around of this missing update).


Repository:
  rL LLVM

https://reviews.llvm.org/D47647

Files:
  llvm/lib/Transforms/Scalar/SimpleLoopUnswitch.cpp
  llvm/test/Transforms/SimpleLoopUnswitch/nontrivial-unswitch.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D47647.149523.patch
Type: text/x-patch
Size: 8531 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180601/79525bac/attachment.bin>


More information about the llvm-commits mailing list