InstCombine: move hasOneUse check to the top of foldICmpAddConstant
authorTim Northover <tnorthover@apple.com>
Mon, 10 Sep 2018 14:26:44 +0000 (14:26 +0000)
committerTim Northover <tnorthover@apple.com>
Mon, 10 Sep 2018 14:26:44 +0000 (14:26 +0000)
commit12c1f7675f0fe14a3071eebf656f3805ea94a2a2
treebb9acb6829553ce136783e69574842b35935164a
parent0b77d03d80d609cdb6f3724eeeb7268ee2ca4700
InstCombine: move hasOneUse check to the top of foldICmpAddConstant

There were two combines not covered by the check before now, neither of which
actually differed from normal in the benefit analysis.

The most recent seems to be because it was just added at the top of the
function (naturally). The older is from way back in 2008 (r46687) when we just
didn't put those checks in so routinely, and has been diligently maintained
since.

llvm-svn: 341831
llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
llvm/test/Analysis/ValueTracking/non-negative-phi-bits.ll
llvm/test/Transforms/InstCombine/icmp-add.ll
llvm/test/Transforms/LoopVectorize/X86/masked_load_store.ll
llvm/test/Transforms/LoopVectorize/if-conversion-nest.ll
llvm/test/Transforms/LoopVectorize/runtime-check.ll