llvm-project/llvm/test/Transforms/SimpleLoopUnswitch
Fedor Sergeev f9a02a7006 [SimpleLoopUnswitch] partial unswitch needs to be careful when replacing invariants with constants
When partial unswitch operates on multiple conditions at once, .e.g:
   if (Cond1 || Cond2 || NonInv) ...

it should infer (and replace) values for individual conditions only on one
side of unswitch and not another.

More precisely only these derivations hold true:
   (Cond1 || Cond2) == false  =>  Cond1 == Cond2 == false
   (Cond1 && Cond2) == true   =>  Cond1 == Cond2 == true

By the way we organize unswitching it means only replacing on "continue" blocks
and never on "unswitched" ones. Since trivial unswitch does not have "unswitched"
blocks it does not have this problem.

Fixes PR 39568.

Reviewers: chandlerc, asbirlea
Differential Revision: https://reviews.llvm.org/D54211

llvm-svn: 346350
2018-11-07 20:05:11 +00:00
..
2006-06-13-SingleEntryPHI.ll
2006-06-27-DeadSwitchCase.ll
2007-05-09-Unreachable.ll
2007-05-09-tl.ll
2007-07-12-ExitDomInfo.ll
2007-07-13-DomInfo.ll
2007-07-18-DomInfo.ll
2007-08-01-Dom.ll
2007-08-01-LCSSA.ll
2007-10-04-DomFrontier.ll
2008-06-02-DomInfo.ll
2008-06-17-DomFrontier.ll
2010-11-18-LCSSA.ll
2011-06-02-CritSwitch.ll
2011-09-26-EHCrash.ll
2012-04-02-IndirectBr.ll
2012-04-30-LoopUnswitch-LPad-Crash.ll
2012-05-20-Phi.ll
2015-09-18-Addrspace.ll
LIV-loop-condtion.ll [PM/LoopUnswitch] Support partial trivial unswitching. 2018-06-20 18:57:07 +00:00
basictest.ll
cleanuppad.ll
copy-metadata.ll
crash.ll
delete-dead-blocks.ll [SimpleLoopUnswitch] remove a chain of dead blocks at once 2018-09-04 20:19:41 +00:00
exponential-behavior.ll
formDedicatedAfterTrivial1.ll [SimpleLoopUnswitch] Form dedicated exits after trivial unswitches. 2018-08-28 20:41:05 +00:00
formDedicatedAfterTrivial2.ll [SimpleLoopUnswitch] Form dedicated exits after trivial unswitches. 2018-08-28 20:41:05 +00:00
formDedicatedAfterTrivial3.ll [SimpleLoopUnswitch] Form dedicated exits after trivial unswitches. 2018-08-28 20:41:05 +00:00
guards.ll [SimpleLoopUnswitch] Unswitch by experimental.guard intrinsics 2018-10-26 14:20:11 +00:00
infinite-loop.ll
msan.ll
nontrivial-unswitch-cost.ll
nontrivial-unswitch.ll [SimpleLoopUnswitch] partial unswitch needs to be careful when replacing invariants with constants 2018-11-07 20:05:11 +00:00
pr37888.ll [LegacyPM] Fix PR37888 by teaching the legacy loop pass manager how to 2018-06-22 02:43:41 +00:00
preserve-analyses.ll
trivial-unswitch-iteration.ll Generalize MergeBlockIntoPredecessor. Replace uses of MergeBasicBlockIntoOnlyPred. 2018-06-20 22:01:04 +00:00
trivial-unswitch.ll [PM/Unswitch] Fix a collection of closely related issues with trivial 2018-07-10 08:36:05 +00:00
update-scev.ll [PM/Unswitch] Fix a collection of closely related issues with trivial 2018-07-10 08:36:05 +00:00