[InstCombine] move constant check into foldBinOpIntoSelectOrPhi; NFCI
authorSanjay Patel <spatel@rotateright.com>
Wed, 28 Feb 2018 16:36:24 +0000 (16:36 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 28 Feb 2018 16:36:24 +0000 (16:36 +0000)
commit8fdd87f9292cdd2419f3f10b3d8c12bcef5aee36
treedafbee07e9bc079dbfa4edae6714340f5d91a7e1
parent9de940b93bdbb0cf032b8337c5390630ba5e1acd
[InstCombine] move constant check into foldBinOpIntoSelectOrPhi; NFCI

Also, rename 'foldOpWithConstantIntoOperand' because that's annoyingly
vague. The constant check is redundant in some cases, but it allows
removing duplication for most of the calls.

llvm-svn: 326329
llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/lib/Transforms/InstCombine/InstCombineInternal.h
llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
llvm/lib/Transforms/InstCombine/InstructionCombining.cpp