summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 9e80bbef3c8..9ab98ce6175 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -3319,13 +3319,6 @@ void llvm::getUnderlyingObjectsForCodeGen(const Value *V,
GetUnderlyingObjects(const_cast<Value *>(V), Objs, DL);
for (Value *V : Objs) {
- // If GetUnderlyingObjects fails to find an identifiable object,
- // getUnderlyingObjectsForCodeGen also fails for safety.
- if (!isIdentifiedObject(V)) {
- Objects.clear();
- return;
- }
-
if (!Visited.insert(V).second)
continue;
if (Operator::getOpcode(V) == Instruction::IntToPtr) {
@@ -3336,6 +3329,12 @@ void llvm::getUnderlyingObjectsForCodeGen(const Value *V,
continue;
}
}
+ // If GetUnderlyingObjects fails to find an identifiable object,
+ // getUnderlyingObjectsForCodeGen also fails for safety.
+ if (!isIdentifiedObject(V)) {
+ Objects.clear();
+ return;
+ }
Objects.push_back(const_cast<Value *>(V));
}
} while (!Working.empty());
OpenPOWER on IntegriCloud