diff options
| author | Dan Gohman <gohman@apple.com> | 2010-12-15 20:49:55 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-12-15 20:49:55 +0000 |
| commit | 05b18f143f91b3b52234a6f31594461eebed413f (patch) | |
| tree | da53d65ada971a5adad22e38b33d3200dbd067a7 /llvm/lib/Analysis/ValueTracking.cpp | |
| parent | 5949cfe11bdb730a987e963b450ceb8eabe15f47 (diff) | |
| download | llvm-05b18f143f91b3b52234a6f31594461eebed413f.zip llvm-05b18f143f91b3b52234a6f31594461eebed413f.tar.gz llvm-05b18f143f91b3b52234a6f31594461eebed413f.tar.bz2 | |
Reapply r121886, and also update DecomposeGEPExpression to keep
it in sync.
llvm-svn: 121895
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
| -rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index ae253ab..7506295 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -1441,6 +1441,14 @@ Value *llvm::GetUnderlyingObject(Value *V, unsigned MaxLookup) { return V; V = GA->getAliasee(); } else { + // See if InstructionSimplify knows any relevant tricks. + if (Instruction *I = dyn_cast<Instruction>(V)) + // TODO: Aquire TargetData and DominatorTree and use them. + if (Value *Simplified = SimplifyInstruction(I, 0, 0)) { + V = Simplified; + continue; + } + return V; } assert(V->getType()->isPointerTy() && "Unexpected operand type!"); |
