[all-commits] [llvm/llvm-project] db7a87: [SimpleLoopUnswitch] Collect either logical ANDs/O...
Florian Hahn via All-commits
all-commits at lists.llvm.org
Fri May 6 01:50:36 PDT 2022
Author: Florian Hahn <flo at fhahn.com>
Date: 2022-05-06 (Fri, 06 May 2022)
[SimpleLoopUnswitch] Collect either logical ANDs/ORs but not both.
After D97756, collectHomogenousInstGraphLoopInvariants may collect
conditions for both logical ANDs and logical ORs in case the root is a
select that matches both logical AND & OR.
This means the function won't return invariant values of either AND/OR
chains, but both. This can result in incorrect transformations.
Without the patch, Alive2 rejects the modified tests with:
Source and target don't have the same return domain.
Note that this also applies to the test case added in D97756
(@test_partial_condition_unswitch_or_select). We can't unswitch on
%cond6, because the graph leading to it contains and AND and an OR.
This only fixes trivial unswitching for now, but a similar problem
likely exists with non-trivial unswitching.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D124526
More information about the All-commits