diff options
| author | Philip Reames <listmail@philipreames.com> | 2016-03-09 21:31:47 +0000 |
|---|---|---|
| committer | Philip Reames <listmail@philipreames.com> | 2016-03-09 21:31:47 +0000 |
| commit | 8f12eba78d7ef7cd849af8e6658e6a20c6f6f772 (patch) | |
| tree | 394453df7083c9113b4d4b1676f6a209e24008cb /llvm/lib/Transforms | |
| parent | 2b4df612ecb3503cb849231f96e2b90f8db546fe (diff) | |
| download | bcm5719-llvm-8f12eba78d7ef7cd849af8e6658e6a20c6f6f772.tar.gz bcm5719-llvm-8f12eba78d7ef7cd849af8e6658e6a20c6f6f772.zip | |
[ValueTracking] Extract isKnownPositive [NFCI]
Extract out a generic interface from a recently landed patch and document a TODO in case compile time becomes a problem.
llvm-svn: 263062
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 703506d8098..7401cb6034a 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -3178,9 +3178,9 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { if (auto *SI = dyn_cast<SelectInst>(Op0)) { SelectPatternResult SPR = matchSelectPattern(SI, A, B); if (SPR.Flavor == SPF_SMIN) { - if (isKnownNonNegative(A, DL) && isKnownNonZero(A, DL)) + if (isKnownPositive(A, DL)) return new ICmpInst(I.getPredicate(), B, CI); - if (isKnownNonNegative(B, DL) && isKnownNonZero(B, DL)) + if (isKnownPositive(B, DL)) return new ICmpInst(I.getPredicate(), A, CI); } } |

