Skip to content

Commit 291ffd2

Browse files
committed
Rename to getUnderlyingObjectAggressive
1 parent f98349d commit 291ffd2

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

llvm/include/llvm/Analysis/ValueTracking.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,10 +736,10 @@ inline Value *getUnderlyingObject(Value *V, unsigned MaxLookup = 6) {
736736
return const_cast<Value *>(getUnderlyingObject(VConst, MaxLookup));
737737
}
738738

739-
/// Like getUnderlyingObject(), but will also look through phi/select nodes
740-
/// to establish a single underlying object.
741-
const Value *getUnderlyingObjectThroughPhisAndSelects(const Value *V,
742-
unsigned MaxLookup = 6);
739+
/// Like getUnderlyingObject(), but will try harder to find a single underlying
740+
/// object. In particular, this function also looks through selects and phis.
741+
const Value *getUnderlyingObjectAggressive(const Value *V,
742+
unsigned MaxLookup = 6);
743743

744744
/// This method is similar to getUnderlyingObject except that it can
745745
/// look through phi and select instructions and return multiple objects.

llvm/lib/Analysis/Loads.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,8 @@ static bool isPointerAlwaysReplaceable(const Value *From, const Value *To,
743743
if (isa<Constant>(To) &&
744744
isDereferenceablePointer(To, Type::getInt8Ty(To->getContext()), DL))
745745
return true;
746-
return getUnderlyingObjectThroughPhisAndSelects(From) ==
747-
getUnderlyingObjectThroughPhisAndSelects(To);
746+
return getUnderlyingObjectAggressive(From) ==
747+
getUnderlyingObjectAggressive(To);
748748
}
749749

750750
bool llvm::canReplacePointersInUseIfEqual(const Use &U, const Value *To,

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6609,9 +6609,8 @@ void llvm::getUnderlyingObjects(const Value *V,
66096609
} while (!Worklist.empty());
66106610
}
66116611

6612-
const Value *
6613-
llvm::getUnderlyingObjectThroughPhisAndSelects(const Value *V,
6614-
unsigned MaxLookup) {
6612+
const Value *llvm::getUnderlyingObjectAggressive(const Value *V,
6613+
unsigned MaxLookup) {
66156614
const unsigned MaxVisited = 8;
66166615

66176616
SmallPtrSet<const Value *, 8> Visited;

0 commit comments

Comments
 (0)