llvm-project/llvm/lib/Transforms/InstCombine
Craig Topper f7b86728fa [InstCombine] Simplify binops that are only used by a select and are fed by a select with the same condition.
Summary:
This patch optimizes a binop sandwiched between 2 selects with the same condition. Since we know its only used by the select we can propagate the appropriate input value from the earlier select.

As I'm writing this I realize I may need to avoid doing this for division in case the select was protecting a divide by zero?

Reviewers: spatel, majnemer

Reviewed By: majnemer

Subscribers: llvm-commits

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

llvm-svn: 318267
2017-11-15 05:23:02 +00:00
..
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
InstCombineAddSub.cpp [IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' fast-math-flag 2017-11-06 16:27:15 +00:00
InstCombineAndOrXor.cpp [ValueTracking, InstCombine] canonicalize fcmp ord/uno with non-NAN ops to null constants 2017-09-05 23:13:13 +00:00
InstCombineCalls.cpp [IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' fast-math-flag 2017-11-06 16:27:15 +00:00
InstCombineCasts.cpp [InstCombine] Fix a vector splat handling bug in transformZExtICmp. 2017-10-05 07:59:11 +00:00
InstCombineCompares.cpp [InstCombine] Teach visitICmpInst to not break integer absolute value idioms 2017-11-12 02:28:21 +00:00
InstCombineInternal.h Create instruction classes for identifying any atomicity of memory intrinsic. (NFC) 2017-10-30 19:51:48 +00:00
InstCombineLoadStoreAlloca.cpp Update getMergedLocation to check the instruction type and merge properly. 2017-10-02 18:13:14 +00:00
InstCombineMulDivRem.cpp [IR] redefine 'UnsafeAlgebra' / 'reassoc' fast-math-flags and add 'trans' fast-math-flag 2017-11-06 16:27:15 +00:00
InstCombinePHI.cpp Renable r314928 2017-10-10 05:07:54 +00:00
InstCombineSelect.cpp [InstCombine] Simplify binops that are only used by a select and are fed by a select with the same condition. 2017-11-15 05:23:02 +00:00
InstCombineShifts.cpp Recommit r317510 "[InstCombine] Pull shifts through a select plus binop with constant" 2017-11-07 18:47:24 +00:00
InstCombineSimplifyDemanded.cpp [InstCombine] improve demanded vector elements analysis of insertelement 2017-08-31 15:57:17 +00:00
InstCombineVectorOps.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-24 21:24:53 +00:00
InstructionCombining.cpp [Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC). 2017-10-24 21:24:53 +00:00
LLVMBuild.txt