llvm-project/llvm/test/Transforms/SimpleLoopUnswitch
Juneyoung Lee 5bb38e84d3 [LoopUnswitch] unswitch if cond is in select form of and/or as well
Hello all,
I'm trying to fix unsafe propagation of poison values in and/or conditions by using
equivalent select forms (`select i1 A, i1 B, i1 false` and `select i1 A, i1 true, i1 false`)
instead.
D93065 has links to patches for this.

This patch allows unswitch to happen if the condition is in this form as well.
`collectHomogenousInstGraphLoopInvariants` is updated to keep traversal if
Root and the visiting I matches both m_LogicalOr()/m_LogicalAnd().
Other than this, the remaining changes are almost straightforward and simply replaces
Instruction::And/Or check with match(m_LogicalOr()/m_LogicalAnd()).

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D97756
2021-03-08 01:19:43 +09:00
..
ARM [NewPM] Only non-trivially loop unswitch at -O3 and for non-optsize functions 2021-01-13 14:54:49 -08: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 OpaquePtr: Bulk update tests to use typed sret 2020-11-20 17:58:26 -05:00
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
basictest-profmd.ll Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
basictest.ll
cleanuppad.ll
copy-metadata.ll
crash.ll
dead-blocks-uses-in-unreachablel-blocks.ll
delete-dead-blocks.ll
exponential-behavior.ll
exponential-nontrivial-unswitch-nested.ll
exponential-nontrivial-unswitch-nested2.ll
exponential-nontrivial-unswitch.ll
exponential-nontrivial-unswitch2.ll
exponential-switch-unswitch.ll
formDedicatedAfterTrivial1.ll
formDedicatedAfterTrivial2.ll
formDedicatedAfterTrivial3.ll
guards.ll
implicit-null-checks.ll
infinite-loop.ll
msan.ll
nontrivial-unswitch-cost.ll
nontrivial-unswitch-redundant-switch.ll
nontrivial-unswitch.ll [LoopUnswitch] unswitch if cond is in select form of and/or as well 2021-03-08 01:19:43 +09:00
not-safe-to-clone.ll [SimpleLoopUnswitch] Don't non-trivially unswitch loops that are unsafe to clone 2021-02-08 13:19:24 -08:00
pipeline.ll [NewPM][Unswitch] Add option to disable -O3 non-trivial unswitching 2021-02-01 11:11:59 -08:00
pr37888.ll Revert "[LoopDeletion] Allows deletion of possibly infinite side-effect free loops" 2020-11-07 00:32:12 -05:00
preserve-analyses.ll
preserve-scev-exiting-multiple-loops.ll
trivial-unswitch-iteration.ll
trivial-unswitch-profmd.ll Revert "Use uint64_t for branch weights instead of uint32_t" 2020-10-31 00:25:32 -07:00
trivial-unswitch.ll [LoopUnswitch] unswitch if cond is in select form of and/or as well 2021-03-08 01:19:43 +09:00
update-scev.ll