llvm-project/llvm/lib/Transforms/InstCombine
Nikita Popov 17863614da [InstCombine] Fold select -> and/or using impliesPoison
We can fold a ? b : false to a & b if is_poison(b) implies that
is_poison(a), at which point we're able to reuse all the usual fold
on ands. In particular, this covers the very common case of
icmp X, C && icmp X, C'. The same applies to ors.

This currently only has an effect if the
-instcombine-unsafe-select-transform=0 option is set.

Differential Revision: https://reviews.llvm.org/D94550
2021-01-13 17:45:40 +01:00
..
CMakeLists.txt llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
InstCombineAddSub.cpp [InstCombine] Transform (A + B) - (A & B) to A | B (PR48604) 2020-12-31 15:04:32 +01:00
InstCombineAndOrXor.cpp [instCombine] Add (A ^ B) | ~(A | B) -> ~(A & B) 2021-01-12 19:29:17 +01:00
InstCombineAtomicRMW.cpp Add missing namespace closure comments. NFCI. 2020-09-23 16:19:25 +01:00
InstCombineCalls.cpp [InstCombine] Handle logical and/or in assume optimization 2021-01-12 22:36:40 +01:00
InstCombineCasts.cpp [STLExtras] Use return type from operator* of the wrapped iter. 2021-01-10 14:41:13 +00:00
InstCombineCompares.cpp [InstCombine] reduce icmp(ashr X, C1), C2 to sign-bit test 2021-01-11 15:53:39 -05:00
InstCombineInternal.h [InstCombine] Remove replacePointer (NFC) 2020-12-06 10:24:08 -08:00
InstCombineLoadStoreAlloca.cpp [X86][AMX] Prohibit pointer cast on load. 2021-01-13 09:39:19 +08:00
InstCombineMulDivRem.cpp [InstCombine] Replace getLogBase2 internal helper with ConstantExpr::getExactLogBase2. NFCI. 2020-10-11 10:31:17 +01:00
InstCombineNegator.cpp [Constant] Add containsPoisonElement 2021-01-06 12:10:33 +09:00
InstCombinePHI.cpp Add missing namespace closure comments. NFCI. 2020-09-23 16:19:25 +01:00
InstCombineSelect.cpp [InstCombine] Fold select -> and/or using impliesPoison 2021-01-13 17:45:40 +01:00
InstCombineShifts.cpp [InstCombine] canonicalize sign-bit-shift of difference to ext(icmp) 2020-12-01 09:58:11 -05:00
InstCombineSimplifyDemanded.cpp [InstCombine] use poison as placeholder for undemanded elems 2020-12-28 08:58:15 +09:00
InstCombineVectorOps.cpp [InstCombine] Use is_contained (NFC) 2020-11-21 15:47:11 -08:00
InstructionCombining.cpp [STLExtras] Use return type from operator* of the wrapped iter. 2021-01-10 14:41:13 +00:00