]> granicus.if.org Git - llvm/commit
[InstCombine] narrow icmp with extended operands of different widths
authorSanjay Patel <spatel@rotateright.com>
Wed, 21 Aug 2019 11:56:08 +0000 (11:56 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 21 Aug 2019 11:56:08 +0000 (11:56 +0000)
commitfdfa6e242302ba90b9cc2f64a010a7bec5b3f27e
treec03b666df1083847fa334795989b91b3ca73eeed
parent561207d0b30cd29b808b921fa325fb60d866099c
[InstCombine] narrow icmp with extended operands of different widths

An intermediate extend is used to widen the narrow operand to the width of
the other (wider) operand. At that point, we have the same logic as the
existing transform that was restricted to folds of equal width zext/sext.

This mostly solves PR42700:
https://bugs.llvm.org/show_bug.cgi?id=42700

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@369519 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Transforms/InstCombine/2004-11-27-SetCCForCastLargerAndConstant.ll