[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)
commit3097b76e8c2c714af6c84e0183280133c873370e
tree0d30373cb41025629e9b7852479b026a3ca14b97
parente785169fcedb9a7ec001df295d5c019b1de51994
[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

llvm-svn: 336172
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Analysis/ValueTracking/non-negative-phi-bits.ll
llvm/test/Transforms/InstCombine/icmp-shl-nsw.ll
llvm/test/Transforms/InstCombine/icmp-shr-lt-gt.ll
llvm/test/Transforms/InstCombine/icmp_sdiv_with_and_without_range.ll
llvm/test/Transforms/LoopVectorize/X86/masked_load_store.ll