Simplify conditional and fix LICM/2004-11-17-UndefIndexCrash.ll
authorChris Lattner <sabre@nondot.org>
Wed, 17 Nov 2004 17:39:39 +0000 (17:39 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 17 Nov 2004 17:39:39 +0000 (17:39 +0000)
by saying what we mean

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17913 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/BasicAliasAnalysis.cpp

index 5ce13f5c5fb2869508bff78035f45c9861334361..875530d7758ee1201d743825dd9421ae952b0560 100644 (file)
@@ -379,8 +379,7 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
           // the arguments provided, except substitute 0's for any variable
           // indexes we find...
           for (unsigned i = 0; i != GEPOperands.size(); ++i)
-            if (!isa<Constant>(GEPOperands[i]) || isa<GlobalValue>(GEPOperands[i]) ||
-                isa<ConstantExpr>(GEPOperands[i]))
+            if (!isa<ConstantInt>(GEPOperands[i]))
               GEPOperands[i] =Constant::getNullValue(GEPOperands[i]->getType());
           int64_t Offset = getTargetData().getIndexedOffset(BasePtr->getType(),
                                                             GEPOperands);