[IR] SelectInst: add swapValues() utility
authorRoman Lebedev <lebedev.ri@gmail.com>
Thu, 1 Aug 2019 12:31:35 +0000 (12:31 +0000)
committerRoman Lebedev <lebedev.ri@gmail.com>
Thu, 1 Aug 2019 12:31:35 +0000 (12:31 +0000)
commit0efeaa81626f4c972a1f792f2b2daea1ad2eb4f5
tree23268ee350c8c7c735d86e429c55c8ccccc5ed10
parentb301860321208253065e5dc74200cfc68f9cf87a
[IR] SelectInst: add swapValues() utility

Summary:
Sometimes we need to swap true-val and false-val of a `SelectInst`.
Having a function for that is nicer than hand-writing it each time.

Reviewers: spatel, RKSimon, craig.topper, jdoerfert

Reviewed By: jdoerfert

Subscribers: jdoerfert, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D65520

llvm-svn: 367547
llvm/include/llvm/IR/Instructions.h
llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
llvm/lib/Transforms/Instrumentation/ControlHeightReduction.cpp