SuccessChanges

Changes from Git (git http://labmaster3.local/git/llvm-project.git)

Summary

  1. [InstCombine] Add more tests for select operand replacement (NFC) (details)
  2. [ASTMatchers] Add mapAnyOf matcher (details)
  3. [ASTMatchers] Make cxxOperatorCallExpr matchers API-compatible with n-ary operators (details)
  4. [LegalizeDAG] Handle NeedInvert when expanding BR_CC (details)
  5. [ASTMatchers] Add binaryOperation matcher (details)
  6. [ASTMatchers] Add support for CXXRewrittenBinaryOperator (details)
  7. Fix llvm::Optional build breaks in MSVC using std::is_trivially_copyable (details)
  8. [Tests] Added tests for new instcombine or simplification; NFC (details)
  9. [InstSimplify] Add (~A & B) | ~(A | B) --> ~A (details)
  10. [RISCV] Correct alignment settings for vector registers. (details)
  11. [InstSimplify] Update comments, remove redundant tests (details)
  12. [LTO] Remove options to disable inlining, vectorization & GVNLoadPRE. (details)
  13. [StringExtras] Fix comment typos (NFC) (details)
  14. [llvm] Construct SmallVector with iterator ranges (NFC) (details)
  15. [llvm] Use *::empty (NFC) (details)
  16. [InstSimplify] Precommit new testcases; NFC (details)
  17. [ARM] Remove LLC tests from transform/hardware loop tests. (details)
  18. [ARM] Add low overhead loops terminators to AnalyzeBranch (details)
  19. [InstSimplify] Handle commutativity for 'and' and 'outer or' for (~A & B) | ~(A | B) --> ~A (details)
  20. [SLP] remove unnecessary use of 'OperationData' (details)
  21. [SLP] fix typos; NFC (details)
  22. [SLP] remove opcode field from reduction data class (details)
  23. [OpenMP] Added the support for hidden helper task in RTL (details)
  24. [mlir][sparse] improved sparse runtime support library (details)
  25. [NFC] Removed extra text in comments (details)
  26. [ARM] Test for aligned blocks. NFC (details)
  27. [ARM] Align blocks that are not fallthough targets (details)
  28. [SimplifyCFG] markAliveBlocks(): catchswitch: preserve PostDomTree (details)
  29. [InstCombine] Replace one-use select operand based on condition (details)
Commit f0a0ec2d085b0bc53e20643b740b20b49cfd9bd5 by nikita.ppv
[InstCombine] Add more tests for select operand replacement (NFC)
The file was modifiedllvm/test/Transforms/InstCombine/select-binop-cmp.ll
Commit a7101450a42e4f1ed5af1a38a6def08f1b5b58fe by steveire
[ASTMatchers] Add mapAnyOf matcher

Make it possible to compose a matcher for different base nodes.

This accepts one or more node matcher functors and zero or more
matchers, composing the latter into the former.

This allows composing of matchers where the same inner matcher name is
used for the same concept, but with a different node functor. Currently,
there is a limitation that the nodes must be in the same "clade", so
while

  mapAnyOf(ifStmt, forStmt).with(hasBody(stmt()))

can be used, functionDecl can not be added to the tuple.

It is possible to use this in clang-query, but it will require changes
to the QueryParser, so is deferred to a future review.

Differential Revision: https://reviews.llvm.org/D94127
The file was modifiedclang/docs/tools/dump_ast_matchers.py
The file was modifiedclang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
The file was modifiedclang/include/clang/ASTMatchers/ASTMatchers.h
The file was modifiedclang/docs/LibASTMatchersReference.html
The file was modifiedclang/include/clang/ASTMatchers/ASTMatchersInternal.h
Commit dbe056c2e37f00b9f33ab63bba73dbb004e13562 by steveire
[ASTMatchers] Make cxxOperatorCallExpr matchers API-compatible with n-ary operators

This makes them composable with mapAnyOf().

Differential Revision: https://reviews.llvm.org/D94128
The file was modifiedclang/docs/LibASTMatchersReference.html
The file was modifiedclang/include/clang/ASTMatchers/ASTMatchersInternal.h
The file was modifiedclang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
The file was modifiedclang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
The file was modifiedclang/include/clang/ASTMatchers/ASTMatchers.h
Commit 4f155567317d3187bc18be866b3f3b5352f1bfa5 by bjorn.a.pettersson
[LegalizeDAG] Handle NeedInvert when expanding BR_CC

This is a follow-up fix to commit 03c8d6a0c4bd0016bdfd1e5.
Seems like we now end up with NeedInvert being set in the result
from LegalizeSetCCCondCode more often than in the past, so we
need to handle NeedInvert when expanding BR_CC.

Not sure how to deal with the "Tmp4.getNode()" case properly,
but current assumption is that that code path isn't impacted
by the changes in 03c8d6a0c4bd0016bdfd1e5 so we can simply move
the old assert into the if-branch and only handle NeedInvert in the
else-branch.

I think that the test case added here, for PowerPC, might have
failed also before commit 03c8d6a0c4bd0016bdfd1e5. But we started
to hit the assert more often downstream when having merged that
commit.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D94762
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
The file was addedllvm/test/CodeGen/PowerPC/legalize-invert-br_cc.ll
Commit e810e95e4bb908d1c8844e2c6f7da999732cabc9 by steveire
[ASTMatchers] Add binaryOperation matcher

This is a simple utility which allows matching on binaryOperator and
cxxOperatorCallExpr. It can also be extended to support
cxxRewrittenBinaryOperator.

Add generic support for MapAnyOfMatchers to auto-marshalling functions.

Differential Revision: https://reviews.llvm.org/D94129
The file was modifiedclang/lib/ASTMatchers/Dynamic/Registry.cpp
The file was modifiedclang/docs/tools/dump_ast_matchers.py
The file was modifiedclang/lib/ASTMatchers/Dynamic/Marshallers.h
The file was modifiedclang/docs/LibASTMatchersReference.html
The file was modifiedclang/lib/ASTMatchers/ASTMatchersInternal.cpp
The file was modifiedclang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
The file was modifiedclang/include/clang/ASTMatchers/ASTMatchers.h
Commit b765eaf9a617bd3da30f47ece731b33593929885 by steveire
[ASTMatchers] Add support for CXXRewrittenBinaryOperator

Differential Revision: https://reviews.llvm.org/D94130
The file was modifiedclang/lib/ASTMatchers/ASTMatchFinder.cpp
The file was modifiedclang/unittests/ASTMatchers/ASTMatchersTraversalTest.cpp
The file was modifiedclang/include/clang/AST/ExprCXX.h
The file was modifiedclang/lib/ASTMatchers/Dynamic/Registry.cpp
The file was modifiedclang/lib/ASTMatchers/ASTMatchersInternal.cpp
The file was modifiedclang/docs/LibASTMatchersReference.html
The file was modifiedclang/unittests/ASTMatchers/ASTMatchersNarrowingTest.cpp
The file was modifiedclang/include/clang/ASTMatchers/ASTMatchers.h
The file was modifiedclang/include/clang/ASTMatchers/ASTMatchersInternal.h
The file was modifiedclang/unittests/AST/ASTTraverserTest.cpp
The file was modifiedclang/include/clang/AST/ASTNodeTraverser.h
Commit 25c1578a46ff93f920b7ad4e3057465902ced8f5 by alexandre.ganea
Fix llvm::Optional build breaks in MSVC using std::is_trivially_copyable

Current code breaks this version of MSVC due to a mismatch between `std::is_trivially_copyable` and `llvm::is_trivially_copyable` for `std::pair` instantiations.  Hence I was attempting to use `std::is_trivially_copyable` to set `llvm::is_trivially_copyable<T>::value`.

I spent some time root causing an `llvm::Optional` build error on MSVC 16.8.3 related to the change described above:

```
62>C:\src\ocg_llvm\llvm-project\llvm\include\llvm/ADT/BreadthFirstIterator.h(96,12): error C2280: 'llvm::Optional<std::pair<std::pair<unsigned int,llvm::Graph<4>::NodeSubset> *,llvm::Optional<llvm::Graph<4>::ChildIterator>>> &llvm::Optional<std::pair<std::pair<unsigned int,llvm::Graph<4>::NodeSubset> *,llvm::Optional<llvm::Graph<4>::ChildIterator>>>::operator =(const llvm::Optional<std::pair<std::pair<unsigned int,llvm::Graph<4>::NodeSubset> *,llvm::Optional<llvm::Graph<4>::ChildIterator>>> &)': attempting to reference a deleted function (compiling source file C:\src\ocg_llvm\llvm-project\llvm\unittests\ADT\BreadthFirstIteratorTest.cpp)
...
```
The "trivial" specialization of `optional_detail::OptionalStorage` assumes that the value type is trivially copy constructible and trivially copy assignable. The specialization is invoked based on a check of `is_trivially_copyable` alone, which does not imply both `is_trivially_copy_assignable` and `is_trivially_copy_constructible` are true.

[[ https://en.cppreference.com/w/cpp/named_req/TriviallyCopyable | According to the spec ]], a deleted assignment operator does not make `is_trivially_copyable` false. So I think all these properties need to be checked explicitly in order to specialize `OptionalStorage` to the "trivial" version:
```
/// Storage for any type.
template <typename T, bool = std::is_trivially_copy_constructible<T>::value
                          && std::is_trivially_copy_assignable<T>::value>
class OptionalStorage {
```
Above fixed my build break in MSVC, but I think we need to explicitly check `is_trivially_copy_constructible` too since it might be possible the copy constructor is deleted.  Also would be ideal to move over to `std::is_trivially_copyable` instead of the `llvm` namespace verson.

Reviewed By: dblaikie

Differential Revision: https://reviews.llvm.org/D93510
The file was modifiedllvm/unittests/ADT/OptionalTest.cpp
The file was modifiedllvm/include/llvm/ADT/Optional.h
Commit 9fc814ed59669d8f1d06cde5714c17fac652f2a1 by Dávid Bolvanský
[Tests] Added tests for new instcombine or simplification; NFC
The file was modifiedllvm/test/Transforms/InstCombine/or.ll
Commit a4e2a5145a29af678139f33e94ab3df0fc973e59 by Dávid Bolvanský
[InstSimplify] Add (~A & B) | ~(A | B) --> ~A
The file was modifiedllvm/test/Transforms/InstSimplify/or.ll
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
Commit 098dbf190a5586d02f48b84eb41b93b701cdeb97 by kai.wang
[RISCV] Correct alignment settings for vector registers.

According to "9. Vector Memory Alignment Constraints" in V
specification, the alignment of vector memory access is aligned to the
size of the element. In our current implementation, we support ELEN up
to 64. We could assume the alignment of vector registers is 64 under the
assumption.

Differential Revision: https://reviews.llvm.org/D94751
The file was modifiedllvm/lib/Target/RISCV/RISCVRegisterInfo.td
Commit bdd4dda58b0de08bd3474fb8d4589a9ba9349e88 by Dávid Bolvanský
[InstSimplify] Update comments, remove redundant tests
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
The file was modifiedllvm/test/Transforms/InstCombine/or.ll
Commit bca16e2fbb451f125c13f811f9f5a37bb38e54e2 by flo
[LTO] Remove options to disable inlining, vectorization & GVNLoadPRE.

This patch removes some ancient options as a clean-up before moving
code-gen to use LTOBackend in D94487.

I think it would preferable to remove those ancient options, because

  1. There are no corresponding options in LTOBackend based tools,
  2. There are no unit tests for them,
  3. They are not passed through by Clang,
  4. At least for GNVLoadPRE, users could just use GVN's `enable-load-pre`.

Alternatively we could add support for those options to lto::Config &
co, but I think it would be better to remove them, unless they are
actually used in practice.

Reviewed By: steven_wu, tejohnson

Differential Revision: https://reviews.llvm.org/D94783
The file was modifiedllvm/lib/LTO/LTOCodeGenerator.cpp
The file was modifiedllvm/tools/lto/lto.cpp
The file was modifiedllvm/tools/llvm-lto/llvm-lto.cpp
The file was modifiedllvm/include/llvm/LTO/legacy/LTOCodeGenerator.h
Commit ba0fc7e1f8d57a7a7dce1a2d604b12e5210dc10f by kazu
[StringExtras] Fix comment typos (NFC)
The file was modifiedllvm/include/llvm/ADT/StringExtras.h
Commit 19aacdb715aea1de56a47b807a555335610a11c2 by kazu
[llvm] Construct SmallVector with iterator ranges (NFC)
The file was modifiedllvm/lib/Transforms/Vectorize/VPlan.cpp
The file was modifiedllvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
The file was modifiedllvm/lib/Transforms/Utils/LCSSA.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp
The file was modifiedllvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
The file was modifiedllvm/lib/IR/LLVMContextImpl.cpp
The file was modifiedllvm/include/llvm/Support/GenericDomTree.h
The file was modifiedllvm/lib/Transforms/Utils/CallPromotionUtils.cpp
The file was modifiedllvm/lib/Analysis/ScalarEvolution.cpp
The file was modifiedllvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
The file was modifiedllvm/lib/Transforms/Utils/Debugify.cpp
The file was modifiedllvm/lib/Target/NVPTX/NVPTXISelDAGToDAG.cpp
The file was modifiedllvm/lib/Transforms/IPO/ArgumentPromotion.cpp
Commit 2082b10d100e8dbaffc2ba8f497db5d2ab61beb2 by kazu
[llvm] Use *::empty (NFC)
The file was modifiedllvm/lib/Target/X86/X86ISelLowering.cpp
The file was modifiedllvm/lib/Target/X86/X86CmovConversion.cpp
The file was modifiedllvm/tools/llvm-readobj/ELFDumper.cpp
The file was modifiedllvm/lib/CodeGen/RegisterScavenging.cpp
The file was modifiedllvm/lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
The file was modifiedllvm/lib/CodeGen/PHIElimination.cpp
The file was modifiedllvm/lib/Analysis/CGSCCPassManager.cpp
The file was modifiedllvm/lib/Transforms/Scalar/SROA.cpp
The file was modifiedllvm/lib/Target/AMDGPU/AMDILCFGStructurizer.cpp
The file was modifiedllvm/lib/Target/ARM/ARMConstantIslandPass.cpp
The file was modifiedllvm/tools/llvm-exegesis/lib/Target.cpp
The file was modifiedllvm/lib/Object/SymbolSize.cpp
The file was modifiedllvm/lib/CodeGen/BranchFolding.cpp
The file was modifiedllvm/lib/Target/Hexagon/HexagonExpandCondsets.cpp
The file was modifiedllvm/lib/CodeGen/FixupStatepointCallerSaved.cpp
Commit 416854d0f7cda90def07e9b4aee14505f222b0b3 by Dávid Bolvanský
[InstSimplify] Precommit new testcases; NFC
The file was modifiedllvm/test/Transforms/InstSimplify/or.ll
Commit c1ab698dce8dd4e751e63142ebb333d5b90bb8dc by david.green
[ARM] Remove LLC tests from transform/hardware loop tests.

We now have a lot of llc tests for hardware loops in CodeGen, which test
a larger variety of loops and are easier to maintain. This removes the
llc from mixed llc/opt tests.
The file was modifiedllvm/test/Transforms/HardwareLoops/ARM/structure.ll
Commit 372eb2bbb6fb903ce76266e659dfefbaee67722b by david.green
[ARM] Add low overhead loops terminators to AnalyzeBranch

This treats low overhead loop branches the same as jump tables and
indirect branches in analyzeBranch - they cannot be analyzed but the
direct branches on the end of the block may be removed. This helps
remove the unnecessary branches earlier, which can help produce better
codegen (and change block layout in a number of cases).

Differential Revision: https://reviews.llvm.org/D94392
The file was modifiedllvm/test/CodeGen/Thumb2/mve-vldshuffle.ll
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/mve-float-loops.ll
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/sibling-loops.ll
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/varying-outer-2d-reduction.ll
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/fast-fp-loops.ll
The file was modifiedllvm/lib/Target/ARM/ARMBaseInstrInfo.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/mve-float16regloops.ll
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/vcmp-vpst-combination.ll
The file was modifiedllvm/lib/Target/ARM/ARMBaseInstrInfo.h
The file was modifiedllvm/test/CodeGen/Thumb2/mve-gather-increment.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-satmul-loops.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-scatter-increment.ll
The file was modifiedllvm/test/CodeGen/Thumb2/LowOverheadLoops/while-loops.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-gather-scatter-optimisation.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-vecreduce-loops.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-float32regloops.ll
The file was modifiedllvm/test/CodeGen/Thumb2/mve-gather-tailpred.ll
Commit 63bedc80da36cf5eb71b06b453c186e057607bf4 by Dávid Bolvanský
[InstSimplify] Handle commutativity for 'and' and 'outer or' for (~A & B) | ~(A | B) --> ~A

Reviewed By: lebedev.ri

Differential Revision: https://reviews.llvm.org/D94870
The file was modifiedllvm/test/Transforms/InstSimplify/or.ll
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
Commit 48dbac5b6b0bc7a03e9af42cb99176abba8d0467 by spatel
[SLP] remove unnecessary use of 'OperationData'

This is another NFC-intended patch to allow matching
intrinsics (example: maxnum) as candidates for reductions.

It's possible that the loop/if logic can be reduced now,
but it's still difficult to understand how this all works.
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Commit fcfcc3cc6b16e4fd7d7d2d07937634cca360b46e by spatel
[SLP] fix typos; NFC
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Commit 49b96cd9ef2f81d193641796b8a85781292faf7a by spatel
[SLP] remove opcode field from reduction data class

This is NFC-intended and another step towards supporting
intrinsics as reduction candidates.

The remaining bits of the OperationData class do not make
much sense as-is, so I will try to improve that, but I'm
trying to take minimal steps because it's still not clear
how this was intended to work.
The file was modifiedllvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
Commit ed939f853da1f2266f00ea087f778fda88848f73 by tianshilei1992
[OpenMP] Added the support for hidden helper task in RTL

The basic design is to create an outer-most parallel team. It is not a regular team because it is only created when the first hidden helper task is encountered, and is only responsible for the execution of hidden helper tasks.  We first use `pthread_create` to create a new thread, let's call it the initial and also the main thread of the hidden helper team. This initial thread then initializes a new root, just like what RTL does in initialization. After that, it directly calls `__kmpc_fork_call`. It is like the initial thread encounters a parallel region. The wrapped function for this team is, for main thread, which is the initial thread that we create via `pthread_create` on Linux, waits on a condition variable. The condition variable can only be signaled when RTL is being destroyed. For other work threads, they just do nothing. The reason that main thread needs to wait there is, in current implementation, once the main thread finishes the wrapped function of this team, it starts to free the team which is not what we want.

Two environment variables, `LIBOMP_NUM_HIDDEN_HELPER_THREADS` and `LIBOMP_USE_HIDDEN_HELPER_TASK`, are also set to configure the number of threads and enable/disable this feature. By default, the number of hidden helper threads is 8.

Here are some open issues to be discussed:
1. The main thread goes to sleeping when the initialization is finished. As Andrey mentioned, we might need it to be awaken from time to time to do some stuffs. What kind of update/check should be put here?

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D77609
The file was modifiedopenmp/runtime/src/kmp.h
The file was modifiedopenmp/runtime/src/kmp_wait_release.h
The file was modifiedopenmp/runtime/src/kmp_runtime.cpp
The file was modifiedopenmp/runtime/src/kmp_tasking.cpp
The file was modifiedopenmp/runtime/test/worksharing/for/kmp_sch_simd_guided.c
The file was addedopenmp/runtime/test/tasking/hidden_helper_task/gtid.cpp
The file was modifiedopenmp/runtime/src/z_Linux_util.cpp
The file was addedopenmp/runtime/test/tasking/hidden_helper_task/taskgroup.cpp
The file was modifiedopenmp/runtime/src/kmp_settings.cpp
The file was addedopenmp/runtime/test/tasking/hidden_helper_task/common.h
The file was modifiedopenmp/runtime/src/kmp_taskdeps.h
The file was addedopenmp/runtime/test/tasking/hidden_helper_task/depend.cpp
The file was modifiedopenmp/runtime/src/kmp_global.cpp
Commit d8fc27301d18f0935ba99ead7ac61aa6a53f16e4 by ajcbik
[mlir][sparse] improved sparse runtime support library

Added the ability to read (an extended version of) the FROSTT
file format, so that we can now read in sparse tensors of arbitrary
rank. Generalized the API to deal with more than two dimensions.

Also added the ability to sort the indices of sparse tensors
lexicographically. This is an important step towards supporting
auto gen of initialization code, since sparse storage formats
are easier to initialize if the indices are sorted. Since most
external formats don't enforce such properties, it is convenient
to have this ability in our runtime support library.

Lastly, the re-entrant problem of the original implementation
is fixed by passing an opaque object around (rather than having
a single static variable, ugh!).

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D94852
The file was modifiedmlir/lib/ExecutionEngine/SparseUtils.cpp
The file was modifiedmlir/include/mlir/ExecutionEngine/CRunnerUtils.h
The file was addedmlir/integration_test/data/test.tns
The file was addedmlir/integration_test/Sparse/CPU/frostt-example.mlir
The file was modifiedmlir/integration_test/Sparse/CPU/matrix-market-example.mlir
The file was modifiedmlir/integration_test/CMakeLists.txt
Commit bfd75bdf3fd62d4f5e7028d4122f9ffa517f2a09 by Dávid Bolvanský
[NFC] Removed extra text in comments
The file was modifiedllvm/lib/Analysis/InstructionSimplify.cpp
Commit 2a5b576e3ea41c30537435d989a3dce7a409f8e2 by david.green
[ARM] Test for aligned blocks. NFC
The file was addedllvm/test/CodeGen/Thumb2/aligned-nonfallthrough.ll
Commit 145472421535c71a9ea60af7e5d012ab69dc85ff by david.green
[ARM] Align blocks that are not fallthough targets

If the previous block in a function does not fallthough, adding nop's to
align it will never be executed. This means we can freely (except for
codesize) align more branches. This happens in constantislandspass (as
it cannot happen later) and only happens at aggressive optimization
levels as it does increase codesize.

Differential Revision: https://reviews.llvm.org/D94394
The file was modifiedllvm/lib/Target/ARM/ARMConstantIslandPass.cpp
The file was modifiedllvm/test/CodeGen/Thumb2/aligned-nonfallthrough.ll
The file was modifiedllvm/test/CodeGen/ARM/ParallelDSP/multi-use-loads.ll
Commit 32fc32317a31fc00e7e4086d6c93dd1eab75960c by lebedev.ri
[SimplifyCFG] markAliveBlocks(): catchswitch: preserve PostDomTree

When removing catchpad's from catchswitch, if that removes a successor,
we need to record that in DomTreeUpdater.

This fixes PostDomTree preservation failure in an existing test.
This appears to be the single issue that i see in my current test coverage.
The file was modifiedllvm/lib/Transforms/Utils/Local.cpp
Commit 5238e7b302ffc40707677960da9d64e872745dac by nikita.ppv
[InstCombine] Replace one-use select operand based on condition

InstCombine already performs a fold where X == Y ? f(X) : Z is
transformed to X == Y ? f(Y) : Z if f(Y) simplifies. However,
if f(X) only has one use, then we can always directly replace the
use inside the instruction. To actually be profitable, limit it to
the case where Y is a non-expr constant.

This could be further extended to replace uses further up a one-use
instruction chain, but for now this only looks one level up.

Among other things, this also subsumes D94860.

Differential Revision: https://reviews.llvm.org/D94862
The file was modifiedllvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
The file was modifiedllvm/test/Transforms/InstCombine/select-safe-transforms.ll
The file was modifiedllvm/test/Transforms/InstCombine/select-binop-cmp.ll