Changes

Summary

  1. [SimplifyCFG] HoistThenElseCodeToIf(): don't hoist if either block has it's address taken (details)
  2. [SimplifyCFG] FoldTwoEntryPHINode(): don't fold if either block has it's address taken (details)
Commit ad87761925c2790aab272138b5bbbde4a93e0383 by lebedev.ri
[SimplifyCFG] HoistThenElseCodeToIf(): don't hoist if either block has it's address taken

This problem is exposed by D104598, after it tail-merges `ret` in
`@test_inline_constraint_S_label`, the verifier would start complaining
`invalid operand for inline asm constraint 'S'`.

Essentially, taking address of a block is mismodelled in IR.
It should probably be an explicit instruction, a first one in block,
that isn't identical to any other instruction of the same type,
so that it can't be hoisted.
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
The file was addedllvm/test/Transforms/SimplifyCFG/hoist-from-addresstaken-block.ll
The file was modifiedllvm/test/CodeGen/AArch64/inlineasm-S-constraint.ll
Commit c5b7335dc8ebdf6c007363631ae154e97ea4a733 by lebedev.ri
[SimplifyCFG] FoldTwoEntryPHINode(): don't fold if either block has it's address taken

Same as with HoistThenElseCodeToIf() (ad87761925c2790aab272138b5bbbde4a93e0383).
The file was modifiedllvm/test/CodeGen/AArch64/inlineasm-S-constraint.ll
The file was modifiedllvm/test/Transforms/SimplifyCFG/hoist-from-addresstaken-block.ll
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp