diff options
| author | Max Kazantsev <max.kazantsev@azul.com> | 2018-07-06 04:04:13 +0000 |
|---|---|---|
| committer | Max Kazantsev <max.kazantsev@azul.com> | 2018-07-06 04:04:13 +0000 |
| commit | 20da7e467aff1949397a8d3ff56eb5df8424e0c8 (patch) | |
| tree | 1b85065f055e0ae23ed382ed176a3b86b28ce59b /llvm/lib/Transforms | |
| parent | 7b35585ff13d833e4736f8169c9ea200dd011aeb (diff) | |
| download | bcm5719-llvm-20da7e467aff1949397a8d3ff56eb5df8424e0c8.tar.gz bcm5719-llvm-20da7e467aff1949397a8d3ff56eb5df8424e0c8.zip | |
Revert "[InstCombine] Delay foldICmpUsingKnownBits until simple transforms are done"
llvm-svn: 336410
Diffstat (limited to 'llvm/lib/Transforms')
| -rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index 41e4124d686..d52ea2cf6eb 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -4485,6 +4485,9 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { if (Instruction *Res = foldICmpWithConstant(I)) return Res; + if (Instruction *Res = foldICmpUsingKnownBits(I)) + return Res; + // Test if the ICmpInst instruction is used exclusively by a select as // part of a minimum or maximum operation. If so, refrain from doing // any other folding. This helps out other analyses which understand @@ -4703,13 +4706,6 @@ Instruction *InstCombiner::visitICmpInst(ICmpInst &I) { if (match(Op1, m_Add(m_Value(X), m_ConstantInt(Cst))) && Op0 == X) return foldICmpAddOpConst(X, Cst, I.getSwappedPredicate()); } - - // This may be expensive in compile-time, and transforms based on known bits - // can make further analysis more difficult, so we use it as the last resort - // if we cannot do anything better. - if (Instruction *Res = foldICmpUsingKnownBits(I)) - return Res; - return Changed ? &I : nullptr; } |

