[LICM] Hoist assumes out of loops
authorPhilip Reames <listmail@philipreames.com>
Fri, 10 Aug 2018 22:21:56 +0000 (22:21 +0000)
committerPhilip Reames <listmail@philipreames.com>
Fri, 10 Aug 2018 22:21:56 +0000 (22:21 +0000)
commit85afd1a9a085d8022b2476a2158aaf62864e8d94
tree3d1060453481f35c9fd186c57b8ab25a831b45ee
parentb99f131ffd780170f0e012fca55d23dd0cc8b60a
[LICM] Hoist assumes out of loops

If we have an assume which is known to execute and whose operand is invariant, we can lift that into the pre-header. So long as we don't change which paths the assume executes on, this is a legal transformation. It's likely to be a useful canonicalization as other transforms only look for dominating assumes.

Differential Revision: https://reviews.llvm.org/D50364

llvm-svn: 339481
llvm/lib/Transforms/Scalar/LICM.cpp
llvm/test/Transforms/LICM/assume.ll