[LoopUnswitch] Fix incorrect Modified status
authorDavid Stenberg <david.stenberg@ericsson.com>
Thu, 20 Aug 2020 06:28:24 +0000 (08:28 +0200)
committerDavid Stenberg <david.stenberg@ericsson.com>
Thu, 20 Aug 2020 07:04:16 +0000 (09:04 +0200)
commitdfd447c22043b0a64bf1d146735ca33f926bd22d
tree8ebf6525cfe6eb2b72ae19beca879b6d2745cd42
parent012819f30183200230d20655595481d596ac35ab
[LoopUnswitch] Fix incorrect Modified status

When hoisting simple values out from a loop, and an optsize attribute, a
convergent call, or an invoke instruction hindered the pass from
unswitching the loop, the pass would return an incorrect Modified
status.

This was caught using the check introduced by D80916.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D86085
llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
llvm/test/Transforms/LoopUnswitch/convergent-hoist-modified.ll [new file with mode: 0644]
llvm/test/Transforms/LoopUnswitch/invoke-hoist-modified.ll [new file with mode: 0644]
llvm/test/Transforms/LoopUnswitch/optsize-hoist-modified.ll [new file with mode: 0644]