diff options
| author | Chris Lattner <sabre@nondot.org> | 2003-06-17 15:25:37 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2003-06-17 15:25:37 +0000 |
| commit | 1bec75e7304bccc2d3c32e24e4df937f04e8d65a (patch) | |
| tree | 8b70dd9fbfdfd0bc561e0d5031daa28431711205 | |
| parent | b9119b3ed42ee9455d0e6c90bac082d37f182762 (diff) | |
| download | bcm5719-llvm-1bec75e7304bccc2d3c32e24e4df937f04e8d65a.tar.gz bcm5719-llvm-1bec75e7304bccc2d3c32e24e4df937f04e8d65a.zip | |
Implement handling of constantexprs for disambiguation. This implements
BasicAA/featuretest.ll:constexpr_test
llvm-svn: 6740
| -rw-r--r-- | llvm/lib/Analysis/BasicAliasAnalysis.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/BasicAliasAnalysis.cpp b/llvm/lib/Analysis/BasicAliasAnalysis.cpp index 42d00c2b605..b56782b5066 100644 --- a/llvm/lib/Analysis/BasicAliasAnalysis.cpp +++ b/llvm/lib/Analysis/BasicAliasAnalysis.cpp @@ -69,6 +69,12 @@ static const Value *getUnderlyingObject(const Value *V) { if (const Instruction *I = dyn_cast<Instruction>(V)) { if (isa<CastInst>(I) || isa<GetElementPtrInst>(I)) return getUnderlyingObject(I->getOperand(0)); + } else if (const ConstantExpr *CE = dyn_cast<ConstantExpr>(V)) { + if (CE->getOpcode() == Instruction::Cast || + CE->getOpcode() == Instruction::GetElementPtr) + return getUnderlyingObject(CE->getOperand(0)); + } else if (const ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(V)) { + return CPR->getValue(); } return 0; } |

