[InstSimplify] use isImpliedCondition() instead of semi-duplicated code
authorSanjay Patel <spatel@rotateright.com>
Fri, 5 Aug 2022 14:59:09 +0000 (10:59 -0400)
committerSanjay Patel <spatel@rotateright.com>
Fri, 5 Aug 2022 14:59:09 +0000 (10:59 -0400)
commit019d76196f79fcff3c148d0163786f9cce70a023
treeee50fce3f5e33d8f9ae73be104081cd6b3ef37fc
parent249a7ed750729b79341fb22003a0f4537883d928
[InstSimplify] use isImpliedCondition() instead of semi-duplicated code

We get a couple of improvements from recognizing swapped
operand patterns that were not handled by the replicated
code.

This should also enable simplifying larger patterns as
seen in issue #56653 and issue #56654, but that requires
enhancements to isImpliedCondition() itself.
llvm/lib/Analysis/InstructionSimplify.cpp
llvm/test/Transforms/InstSimplify/and-icmps-same-ops.ll
llvm/test/Transforms/InstSimplify/or-icmps-same-ops.ll