[IR] Simplify Use::swap. NFCI.
authorJay Foad <jay.foad@amd.com>
Mon, 18 May 2020 10:08:57 +0000 (11:08 +0100)
committerJay Foad <jay.foad@amd.com>
Tue, 21 Jul 2020 11:15:12 +0000 (12:15 +0100)
commit5e5bda74b61b3e8a4434abe2b5fe5d7ac5880ccd
treeeb44857bd62baf314aeae11540a67077a2e77b50
parentbecaa6803ab532d15506829f0551a5fa49c39d7e
[IR] Simplify Use::swap. NFCI.

The new implementation makes it clear that there are exactly two
conditional stores (after the initial no-op optimization). By contrast
the old implementation had seven conditionals, some hidden inside other
functions.

This commit can change the order of operands in operand lists, hence the
tweak to one test case.

Differential Revision: https://reviews.llvm.org/D80116
llvm/lib/IR/Use.cpp
llvm/test/Transforms/LoopReroll/nonconst_lb.ll