summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-01-12 18:20:48 +0000
committerChris Lattner <sabre@nondot.org>2007-01-12 18:20:48 +0000
commit0fd2b9f5c09e611c55c3594eb750cddb766bae4f (patch)
treed2a2bd76a6f347f661c9e0b5413584d763103dcd /llvm/lib/Analysis
parent7f6fac4bb5a425fde5c40fbe781c00244eb1c9fb (diff)
downloadbcm5719-llvm-0fd2b9f5c09e611c55c3594eb750cddb766bae4f.tar.gz
bcm5719-llvm-0fd2b9f5c09e611c55c3594eb750cddb766bae4f.zip
GEP operands can't be bools
llvm-svn: 33125
Diffstat (limited to 'llvm/lib/Analysis')
-rw-r--r--llvm/lib/Analysis/BasicAliasAnalysis.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
index d49898a401c..3f6b722163a 100644
--- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp
+++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp
@@ -434,8 +434,7 @@ BasicAliasAnalysis::alias(const Value *V1, unsigned V1Size,
if (cast<PointerType>(
BasePtr->getType())->getElementType()->isSized()) {
for (unsigned i = 0; i != GEPOperands.size(); ++i)
- if (!isa<ConstantInt>(GEPOperands[i]) ||
- GEPOperands[i]->getType() == Type::Int1Ty)
+ if (!isa<ConstantInt>(GEPOperands[i]))
GEPOperands[i] =
Constant::getNullValue(GEPOperands[i]->getType());
int64_t Offset =
@@ -610,14 +609,12 @@ BasicAliasAnalysis::CheckGEPInstructions(
if (GEP1Ops.size() > MinOperands) {
for (unsigned i = FirstConstantOper; i != MaxOperands; ++i)
if (isa<ConstantInt>(GEP1Ops[i]) &&
- GEP1Ops[i]->getType() != Type::Int1Ty &&
!cast<Constant>(GEP1Ops[i])->isNullValue()) {
// Yup, there's a constant in the tail. Set all variables to
// constants in the GEP instruction to make it suiteable for
// TargetData::getIndexedOffset.
for (i = 0; i != MaxOperands; ++i)
- if (!isa<ConstantInt>(GEP1Ops[i]) ||
- GEP1Ops[i]->getType() == Type::Int1Ty)
+ if (!isa<ConstantInt>(GEP1Ops[i]))
GEP1Ops[i] = Constant::getNullValue(GEP1Ops[i]->getType());
// Okay, now get the offset. This is the relative offset for the full
// instruction.
@@ -670,7 +667,7 @@ BasicAliasAnalysis::CheckGEPInstructions(
const Value *Op2 = i < GEP2Ops.size() ? GEP2Ops[i] : 0;
// If they are equal, use a zero index...
if (Op1 == Op2 && BasePtr1Ty == BasePtr2Ty) {
- if (!isa<ConstantInt>(Op1) || Op1->getType() == Type::Int1Ty)
+ if (!isa<ConstantInt>(Op1))
GEP1Ops[i] = GEP2Ops[i] = Constant::getNullValue(Op1->getType());
// Otherwise, just keep the constants we have.
} else {
OpenPOWER on IntegriCloud