OSDN Git Service

[InstCombine] Delay foldICmpUsingKnownBits until simple transforms are done
authorMax Kazantsev <max.kazantsev@azul.com>
Tue, 3 Jul 2018 06:23:57 +0000 (06:23 +0000)
committerMax Kazantsev <max.kazantsev@azul.com>
Tue, 3 Jul 2018 06:23:57 +0000 (06:23 +0000)
commit6ac04e25a3a4078ece43cc6062286bc6270b5f3e
treeea4020ede95da2e9f59dffe1cb771236e69230d5
parentc978388e74bafcab21d2e12fa1999eebc25f03e8
[InstCombine] Delay foldICmpUsingKnownBits until simple transforms are done

This patch changes order of transform in InstCombineCompares to avoid
performing transforms based on ranges which produce complex bit arithmetics
before more simple things (like folding with constants) are done. See PR37636
for the motivating example.

Differential Revision: https://reviews.llvm.org/D48584
Reviewed By: spatel, lebedev.ri

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@336172 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineCompares.cpp
test/Analysis/ValueTracking/non-negative-phi-bits.ll
test/Transforms/InstCombine/icmp-shl-nsw.ll
test/Transforms/InstCombine/icmp-shr-lt-gt.ll
test/Transforms/InstCombine/icmp_sdiv_with_and_without_range.ll
test/Transforms/LoopVectorize/X86/masked_load_store.ll