diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2008-02-21 09:14:53 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2008-02-21 09:14:53 +0000 |
commit | 39442afb36cfe39315accc36eb2e8355689f0882 (patch) | |
tree | 3f5a2284a49e3c837ee274f0d56e940f018ffa70 /lib | |
parent | 3b71165b32dd631e2a3e5d27fa10c5d6c08d19e2 (diff) | |
download | external_llvm-39442afb36cfe39315accc36eb2e8355689f0882.zip external_llvm-39442afb36cfe39315accc36eb2e8355689f0882.tar.gz external_llvm-39442afb36cfe39315accc36eb2e8355689f0882.tar.bz2 |
Simplify this code, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47434 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 827b1c0..876ebd4 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -2600,11 +2600,8 @@ SCEVHandle ScalarEvolutionsImpl::HowFarToNonZero(SCEV *V, const Loop *L) { // If the value is a constant, check to see if it is known to be non-zero // already. If so, the backedge will execute zero times. if (SCEVConstant *C = dyn_cast<SCEVConstant>(V)) { - Constant *Zero = Constant::getNullValue(C->getValue()->getType()); - Constant *NonZero = - ConstantExpr::getICmp(ICmpInst::ICMP_NE, C->getValue(), Zero); - if (NonZero == ConstantInt::getTrue()) - return getSCEV(Zero); + if (!C->getValue()->isNullValue()) + return SE.getIntegerSCEV(0, C->getType()); return UnknownValue; // Otherwise it will loop infinitely. } |