Note: There is a mailing list discussion on this: http://lists.llvm.org/pipermail/llvm-dev/2019-December/137632.html
This patch introduces an assumption outliner, which is probably not here to
stay but helpful in creating operand bundle annotated llvm.assumes and
outlined assumption code.
Various passes, basically all that seemed interesting and deal with
assumptions, have been updated to work with outlined assumption code to
AlignmentFromAssumptions is used to provide an additional operand bundle
for the llvm.assume that connects the outlined code with its original
location. The operand bundle has the form
`"align"(%ptr, %alignment, %offset)`
and that is the form we should generate in the first place.
The AlignmentFromAssumptionsPass is also able to read "align" operand
bundles on llvm.assume calls.
The other passes that deal with the outlined assumptions do violate
function pass rules but it should be sufficient to test this out.
Test for a few affected passes have been modified to run the outliner
first. While there are problems, overall most transformations are sill
possible and performed already.
A path forward could be to adopt (a clean version of) the outliner for
now but only run it if we can encode the information "natively" in an
operand bundle, e.g., as described for "align" above. We then would
start to emit information in this format in the frontends and decide how
we want to deal with outlining.