SuccessChanges

Summary

  1. [SimplifyCFG][AMDGPU] AMDGPUUnifyDivergentExitNodes: SimplifyCFG isn't ready to preserve PostDomTree (details)
  2. [llvm-reduce] Fix removal of unused llvm intrinsics declarations (details)
  3. [llvm-reduce] Refactor global variable delta pass (details)
  4. [NFC][SimplifyCFG] Add test for switch creation where we fail to maintain DomTree (details)
  5. [SimplifyCFG] FoldValueComparisonIntoPredecessors(): fine-tune/fix DomTree preservation (details)
  6. [NFC][SimplifyCFG] Add another test for switch creation where we fail to maintain DomTree (details)
  7. [SimplifyCFG] FoldValueComparisonIntoPredecessors(): fine-tune/fix DomTree preservation, take 2 (details)
  8. [gn build] Port 5799fc79c3f (details)
Commit 7c8b8063b66c7b936d41a0c4069c506669e13115 by lebedev.ri
[SimplifyCFG][AMDGPU] AMDGPUUnifyDivergentExitNodes: SimplifyCFG isn't ready to preserve PostDomTree

There is a number of transforms in SimplifyCFG that take DomTree out of
DomTreeUpdater, and do updates manually. Until they are fixed,
user passes are unable to claim that PDT is preserved.

Note that the default for SimplifyCFG is still not to preserve DomTree,
so this is still effectively NFC.
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUUnifyDivergentExitNodes.cpp
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
Commit 19ab1817b61d3b716f69f78f727de8bd8887f53f by lebedev.ri
[llvm-reduce] Fix removal of unused llvm intrinsics declarations

ee6e25e4391a6d3ac0a3c89615474e512f44cda6 changed
the delta pass to skip intrinsics, which means we may end up being
left with declarations of intrinsics, that aren't otherwise referenced
in the module. This is obviously unwanted, do drop them.
The file was addedllvm/test/Reduce/remove-unused-declarations.ll
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceFunctions.cpp
Commit 5799fc79c3fdbc81dd421afae38197009ad605c9 by lebedev.ri
[llvm-reduce] Refactor global variable delta pass

The limitation of the current pass that it skips initializer-less GV's
seems arbitrary, in all the reduced cases i (personally) looked at,
the globals weren't needed, yet they were kept.

So let's do two things:
1. allow reducing initializer-less globals
2. before reducing globals, reduce their initializers, much like we do function bodies
The file was modifiedllvm/tools/llvm-reduce/DeltaManager.h
The file was modifiedllvm/tools/llvm-reduce/CMakeLists.txt
The file was addedllvm/tools/llvm-reduce/deltas/ReduceGlobalVarInitializers.h
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceGlobalVars.cpp
The file was modifiedllvm/tools/llvm-reduce/deltas/ReduceGlobalVars.h
The file was removedllvm/test/Reduce/Inputs/remove-global-vars.py
The file was addedllvm/tools/llvm-reduce/deltas/ReduceGlobalVarInitializers.cpp
The file was modifiedllvm/test/Reduce/remove-global-vars.ll
Commit eda50309f5930d249fef4747efb9a047d239ba05 by lebedev.ri
[NFC][SimplifyCFG] Add test for switch creation where we fail to maintain DomTree

Reduced from vanilla test-suite
The file was addedllvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase.ll
Commit 6a3a8d17ebae0669e797ac22a2b2963b89ee12fa by lebedev.ri
[SimplifyCFG] FoldValueComparisonIntoPredecessors(): fine-tune/fix DomTree preservation
The file was modifiedllvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase.ll
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
Commit a0013934b6a194f0ecc4d98118920326b12d07a0 by lebedev.ri
[NFC][SimplifyCFG] Add another test for switch creation where we fail to maintain DomTree
The file was addedllvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase-2.ll
Commit 5fa241a6571c79c1cd0c0d9e7f87e5e361e2dab4 by lebedev.ri
[SimplifyCFG] FoldValueComparisonIntoPredecessors(): fine-tune/fix DomTree preservation, take 2
The file was modifiedllvm/test/Transforms/SimplifyCFG/FoldValueComparisonIntoPredecessors-domtree-preservation-edgecase-2.ll
The file was modifiedllvm/lib/Transforms/Utils/SimplifyCFG.cpp
Commit 835bdd17761293486a63e6b38a94059ba48ac0fc by llvmgnsyncbot
[gn build] Port 5799fc79c3f
The file was modifiedllvm/utils/gn/secondary/llvm/tools/llvm-reduce/BUILD.gn