llvm-project/llvm/lib/Transforms/InstCombine
Juneyoung Lee 39eb2665d9 [InstCombine] Add a few more patterns for folding select of select
This is a patch that folds select of select to salvage some optimizations after select -> and/or folding is disabled.

```
select (select a, true, b), c, false -> select a, c, false
select c, (select a, true, b), false -> select c, a, false
  if c implies that b is false (isImpliedCondition).
```
https://alive2.llvm.org/ce/z/ANatjt, https://alive2.llvm.org/ce/z/rv8zTB

```
sel (sel c, a, false), true, (sel !c, b, false) -> sel c, a, b
sel (sel !c, a, false), true, (sel c, b, false) -> sel c, b, a
```
https://alive2.llvm.org/ce/z/U2kp-t, https://alive2.llvm.org/ce/z/bc88EE

See D101191

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D101375
2021-05-02 19:00:42 +09:00
..
CMakeLists.txt llvmbuildectomy - replace llvm-build by plain cmake 2020-11-13 10:35:24 +01:00
InstCombineAddSub.cpp [InstCombine] C - ctpop(a) - > ctpop(~a)) if C is bitwidth (PR50104) 2021-04-26 15:40:54 +02:00
InstCombineAndOrXor.cpp [InstCombine] Improve "get low bit mask upto and including bit X" pattern 2021-04-11 18:08:08 +03:00
InstCombineAtomicRMW.cpp Add missing namespace closure comments. NFCI. 2020-09-23 16:19:25 +01:00
InstCombineCalls.cpp [InstCombine] narrow popcount with zext operand 2021-04-29 15:07:16 -04:00
InstCombineCasts.cpp [InstCombine] relax masking requirement for truncated funnel/rotate match 2021-04-28 16:49:50 -04:00
InstCombineCompares.cpp Revert "[InstCombine] Fold multiuse shr eq zero" 2021-04-21 21:40:52 +02:00
InstCombineInternal.h Revert "[InstCombine] Recognize `((x * y) s/ x) !=/== y` as an signed multiplication overflow check (PR48769)" 2021-04-20 15:53:34 -07:00
InstCombineLoadStoreAlloca.cpp [CSSPGO] Unblock optimizations with pseudo probe instrumentation part 2. 2021-04-26 16:52:33 -07:00
InstCombineMulDivRem.cpp [InstCombine] fold fdiv with powi divisor (PR49147) 2021-02-24 16:44:36 -05:00
InstCombineNegator.cpp [Transforms] Use range-based for loops (NFC) 2021-02-08 22:33:53 -08:00
InstCombinePHI.cpp [InstCombine] Simplify phis with incoming pointer-casts. 2021-03-09 11:40:18 +00:00
InstCombineSelect.cpp [InstCombine] Add a few more patterns for folding select of select 2021-05-02 19:00:42 +09:00
InstCombineShifts.cpp [InstCombine] fold shift-of-srem-by-2 to mask+shift 2021-04-20 17:10:16 -04:00
InstCombineSimplifyDemanded.cpp [InstCombine] fold 'not' of ctpop in parity pattern 2021-04-23 13:23:24 -04:00
InstCombineVectorOps.cpp Update InstCombine to use undef matcher instead 2021-04-18 11:05:36 +09:00
InstructionCombining.cpp Revert "[instcombine] Exploit UB implied by nofree attributes" 2021-04-22 10:53:17 -07:00