getUnderlyingObject(MaybeTermLoc->first.Ptr))
return false;
+ auto TermLoc = MaybeTermLoc->first;
+ if (MaybeTermLoc->second) {
+ const Value *LocUO = getUnderlyingObject(Loc.Ptr);
+ return BatchAA.isMustAlias(TermLoc.Ptr, LocUO);
+ }
int64_t InstWriteOffset, DepWriteOffset;
- return MaybeTermLoc->second ||
- isOverwrite(MaybeTerm, AccessI, MaybeTermLoc->first, Loc, DL, TLI,
+ return isOverwrite(MaybeTerm, AccessI, TermLoc, Loc, DL, TLI,
DepWriteOffset, InstWriteOffset, BatchAA,
&F) == OW_Complete;
}
; Test case inspired by PR48036.
define void @delete_field_after(%struct* %ptr) {
+;
; CHECK-LABEL: @delete_field_after(
; CHECK-NEXT: [[PTR_F0:%.*]] = getelementptr [[STRUCT:%.*]], %struct* [[PTR:%.*]], i32 1
; CHECK-NEXT: [[BC:%.*]] = bitcast %struct* [[PTR_F0]] to i8*
+; CHECK-NEXT: [[PTR_F1:%.*]] = getelementptr [[STRUCT]], %struct* [[PTR]], i32 0, i32 1
+; CHECK-NEXT: store i32 0, i32* [[PTR_F1]], align 4
; CHECK-NEXT: call void @free(i8* [[BC]])
; CHECK-NEXT: ret void
;