SuccessChanges

Summary

  1. [NFC][SimplifyCFG] Add a test where we fail to preserve DomTree validity (details)
  2. [NFC][SimplifyCFG] SimplifyTerminatorOnSelect(): pull out OldTerm->getParent() into a variable (details)
  3. [SimplifyCFG] SimplifyTerminatorOnSelect(): fix/tune DomTree updates (details)
  4. [NFC][SimplifyCFG] Hoist 'original' DomTree verification from simplifyOnce() into run() (details)
Commit 4fc908025fd003a7517e392f35389364fb60500d by lebedev.ri
[NFC][SimplifyCFG] Add a test where we fail to preserve DomTree validity
The file was addedllvm/test/Transforms/SimplifyCFG/SimplifyTerminatorOnSelect-domtree-preservation-edgecase.ll
Commit 70935b9595a410794882d043726a1aad38d44ebd by lebedev.ri
[NFC][SimplifyCFG] SimplifyTerminatorOnSelect(): pull out OldTerm->getParent() into a variable
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
Commit a7684940f0e4eafb1bafc75cfb0e620ee358abd4 by lebedev.ri
[SimplifyCFG] SimplifyTerminatorOnSelect(): fix/tune DomTree updates

We only need to remove non-TrueBB/non-FalseBB successors,
and we only need to do that once. We don't need to insert
any new edges, because no new successors will be added.
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
The file was modifiedllvm/test/Transforms/SimplifyCFG/SimplifyTerminatorOnSelect-domtree-preservation-edgecase.ll
Commit 98cd1c33e3c2c3cfee36fb0fea3285fda06224d3 by lebedev.ri
[NFC][SimplifyCFG] Hoist 'original' DomTree verification from simplifyOnce() into run()

This is NFC since SimplifyCFG still currently defaults to not preserving DomTree.

SimplifyCFGOpt::simplifyOnce() is only be called from SimplifyCFGOpt::run(),
and can not be called externally, since SimplifyCFGOpt is defined in .cpp
This avoids some needless verifications, and is thus a bit faster
without sacrificing precision.
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp