llvm-project/llvm/lib/Transforms/InstCombine
Sanjay Patel 0fe32ac256 [InstCombine] treat i1 as a special type in shouldChangeType()
This patch is based on the llvm-dev discussion here:
http://lists.llvm.org/pipermail/llvm-dev/2017-January/109631.html

Folding to i1 should always be desirable because that's better for value tracking 
and we have special folds for i1 types.

I checked for other users of shouldChangeType() where this might have an effect, 
but we already handle the i1 case differently than other types in all of those cases.

Side note: the default datalayout includes i1, so it seems we only find this gap in 
shouldChangeType + phi folding for the case when there is (1) an explicit datalayout 
without i1, (2) casting to i1 from a legal type, and (3) a phi with exactly 2 incoming
casted operands (as Björn mentioned).

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

llvm-svn: 294066
2017-02-03 23:13:11 +00:00
..
CMakeLists.txt [CMake] NFC. Updating CMake dependency specifications 2016-11-17 04:36:50 +00:00
InstCombineAddSub.cpp [InstCombine] add a wrapper for a common pair of transforms; NFCI 2017-01-10 23:49:07 +00:00
InstCombineAndOrXor.cpp [InstCombine] Fold ((C1 OP zext(X)) & C2) -> zext((C1 OP X) & C2) 2017-01-17 18:08:06 +00:00
InstCombineCalls.cpp [InstCombine] Allow InstCombine to merge adjacent guards 2017-02-01 16:34:55 +00:00
InstCombineCasts.cpp fix formatting; NFC 2017-01-31 17:25:42 +00:00
InstCombineCompares.cpp fix formatting; NFC 2017-01-31 17:25:42 +00:00
InstCombineInternal.h [InstCombine] fix operand-complexity-based canonicalization (PR28296) 2017-02-03 21:43:34 +00:00
InstCombineLoadStoreAlloca.cpp Don't combine stores to a swifterror pointer operand to a different type 2017-01-31 17:53:49 +00:00
InstCombineMulDivRem.cpp [InstCombine] add a wrapper for a common pair of transforms; NFCI 2017-01-10 23:49:07 +00:00
InstCombinePHI.cpp fix formatting; NFC 2017-01-31 17:25:42 +00:00
InstCombineSelect.cpp Use InstCombine's builder in foldSelectCttzCtlz instead of creating a new one. 2017-01-24 17:48:25 +00:00
InstCombineShifts.cpp [InstCombine] move folds for shift-shift pairs; NFCI 2017-02-01 21:31:34 +00:00
InstCombineSimplifyDemanded.cpp [InstCombine][X86] MULDQ/MULUDQ undef -> zero 2017-01-24 11:07:41 +00:00
InstCombineVectorOps.cpp [InstCombine] Use getVectorNumElements instead of explicitly casting to VectorType and calling getNumElements. NFC 2016-12-29 07:03:18 +00:00
InstructionCombining.cpp [InstCombine] treat i1 as a special type in shouldChangeType() 2017-02-03 23:13:11 +00:00
LLVMBuild.txt Update libdeps since TLI was moved from Target to Analysis in r226078. 2015-01-15 05:21:00 +00:00