When looking for underlying objects, if we encounter one that we
have already seen, then we should skip it (as it has already been
checked) rather than bail out. In particular, this adds support
for the case where we have a loop use of a phi recurrence.
do {
const Value *V = getUnderlyingObject(Worklist.pop_back_val());
if (!Visited.insert(V).second)
- return AAResultBase::pointsToConstantMemory(Loc, AAQI, OrLocal);
+ continue;
// An alloca instruction defines local memory.
if (OrLocal && isa<AllocaInst>(V))
ret void
}
-; FIXME: This should be at least only Ref.
+; FIXME: This could be NoModRef
; CHECK-LABEL: Function: recphi
-; Both ModRef: Ptr: i32* %p <-> call void @dummy()
+; CHECK: Just Ref: Ptr: i32* %p <-> call void @dummy()
define void @recphi() {
entry:
br label %loop
}
define void @alloca_recphi() {
-; CHECK: Function Attrs: nofree norecurse nosync nounwind
+; CHECK: Function Attrs: nofree norecurse nosync nounwind readnone
; CHECK-LABEL: define {{[^@]+}}@alloca_recphi
; CHECK-SAME: () #[[ATTR14:[0-9]+]] {
; CHECK-NEXT: entry: