aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-12-15 20:49:55 +0000
committerDan Gohman <gohman@apple.com>2010-12-15 20:49:55 +0000
commitc01895c7db4c4d8883dd4c31427c42cdae356567 (patch)
tree6ffbcabd44358c76b22f9e10a535b8967a4b1182 /lib/Analysis/ValueTracking.cpp
parente69b4ab82924359ca3d85215fb42aee2495de2f8 (diff)
downloadexternal_llvm-c01895c7db4c4d8883dd4c31427c42cdae356567.zip
external_llvm-c01895c7db4c4d8883dd4c31427c42cdae356567.tar.gz
external_llvm-c01895c7db4c4d8883dd4c31427c42cdae356567.tar.bz2
Reapply r121886, and also update DecomposeGEPExpression to keep
it in sync. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121895 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ValueTracking.cpp')
-rw-r--r--lib/Analysis/ValueTracking.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/Analysis/ValueTracking.cpp b/lib/Analysis/ValueTracking.cpp
index ae253ab..7506295 100644
--- a/lib/Analysis/ValueTracking.cpp
+++ b/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!");