[InstCombine] Fold and of two ranges differing by mask
authorNikita Popov <npopov@redhat.com>
Fri, 29 Apr 2022 09:31:12 +0000 (11:31 +0200)
committerNikita Popov <npopov@redhat.com>
Fri, 29 Apr 2022 10:01:38 +0000 (12:01 +0200)
commit5515263e4462b4bf39184f6a0e24964b4519eae4
treea7e7672749e05c9c90aa5775d502db2f18a1e9a7
parent713752610edd3d8766f56e2704bb7241434cd15b
[InstCombine] Fold and of two ranges differing by mask

This is the de Morgan conjugated variant of the existing fold for
ors. Implement this by switching the range code to always work
on ors and perform invert operands at the start and end. This makes
reasoning easier and makes the extension more obviosuly correct.
llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
llvm/test/Transforms/InstCombine/and-or-icmps.ll