diff options
| author | Dan Gohman <gohman@apple.com> | 2011-01-24 18:53:32 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2011-01-24 18:53:32 +0000 |
| commit | 0f124e1987c22d1801c23c93628d202d21bdff10 (patch) | |
| tree | d673dbf9fcc1de867343c1ee4b96382caa7e1fd6 /llvm/lib/Analysis/ValueTracking.cpp | |
| parent | 62c31346292888357d82f42bac8e1a0e05c356fb (diff) | |
| download | llvm-0f124e1987c22d1801c23c93628d202d21bdff10.zip llvm-0f124e1987c22d1801c23c93628d202d21bdff10.tar.gz llvm-0f124e1987c22d1801c23c93628d202d21bdff10.tar.bz2 | |
Give GetUnderlyingObject a TargetData, to keep it in sync
with BasicAA's DecomposeGEPExpression, which recently began
using a TargetData. This fixes PR8968, though the testcase
is awkward to reduce.
Also, update several off GetUnderlyingObject's users
which happen to have a TargetData handy to pass it in.
llvm-svn: 124134
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
| -rw-r--r-- | llvm/lib/Analysis/ValueTracking.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp index e2d7e92..c982e3e 100644 --- a/llvm/lib/Analysis/ValueTracking.cpp +++ b/llvm/lib/Analysis/ValueTracking.cpp @@ -1504,7 +1504,8 @@ uint64_t llvm::GetStringLength(Value *V) { return Len == ~0ULL ? 1 : Len; } -Value *llvm::GetUnderlyingObject(Value *V, unsigned MaxLookup) { +Value * +llvm::GetUnderlyingObject(Value *V, const TargetData *TD, unsigned MaxLookup) { if (!V->getType()->isPointerTy()) return V; for (unsigned Count = 0; MaxLookup == 0 || Count < MaxLookup; ++Count) { @@ -1519,8 +1520,8 @@ Value *llvm::GetUnderlyingObject(Value *V, unsigned MaxLookup) { } 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)) { + // TODO: Aquire a DominatorTree and use it. + if (Value *Simplified = SimplifyInstruction(I, TD, 0)) { V = Simplified; continue; } |
