aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Analysis/ValueTracking.cpp
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2020-07-30 18:48:34 -0700
committerVitaly Buka <vitalybuka@google.com>2020-07-30 18:48:34 -0700
commitb256cb88a716dfd270745af1bb98b49c22521a99 (patch)
treea9916c1142fc2994d4ead483ec4fbec50ef836c7 /llvm/lib/Analysis/ValueTracking.cpp
parent0f1016562648e0c5ab0618823d5d6b7280ca86ba (diff)
downloadllvm-b256cb88a716dfd270745af1bb98b49c22521a99.zip
llvm-b256cb88a716dfd270745af1bb98b49c22521a99.tar.gz
llvm-b256cb88a716dfd270745af1bb98b49c22521a99.tar.bz2
[ValueTracking] Remove AllocaForValue parameter
findAllocaForValue uses AllocaForValue to cache resolved values. The function is used only to resolve arguments of lifetime intrinsic which usually are not fare for allocas. So result reuse is likely unnoticeable. In followup patches I'd like to replace the function with GetUnderlyingObjects. Depends on D84616. Differential Revision: https://reviews.llvm.org/D84617
Diffstat (limited to 'llvm/lib/Analysis/ValueTracking.cpp')
-rw-r--r--llvm/lib/Analysis/ValueTracking.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 6fb36fa..9dfe8fd 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -4313,9 +4313,8 @@ bool llvm::getUnderlyingObjectsForCodeGen(const Value *V,
return true;
}
-AllocaInst *
-llvm::findAllocaForValue(Value *V,
- DenseMap<Value *, AllocaInst *> &AllocaForValue) {
+static AllocaInst *
+findAllocaForValue(Value *V, DenseMap<Value *, AllocaInst *> &AllocaForValue) {
if (AllocaInst *AI = dyn_cast<AllocaInst>(V))
return AI;
// See if we've already calculated (or started to calculate) alloca for a
@@ -4348,6 +4347,11 @@ llvm::findAllocaForValue(Value *V,
return Res;
}
+AllocaInst *llvm::findAllocaForValue(Value *V) {
+ DenseMap<Value *, AllocaInst *> AllocaForValue;
+ return ::findAllocaForValue(V, AllocaForValue);
+}
+
static bool onlyUsedByLifetimeMarkersOrDroppableInstsHelper(
const Value *V, bool AllowLifetime, bool AllowDroppable) {
for (const User *U : V->users()) {