Skip to content

Commit 9899e69

Browse files
adjust AAMetadata
1 parent 71d9921 commit 9899e69

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,8 +771,12 @@ static Instruction *unpackLoadToAggregate(InstCombinerImpl &IC, LoadInst &LI) {
771771
ST->getElementType(i), Ptr,
772772
commonAlignment(Align, SL->getElementOffset(i).getKnownMinValue()),
773773
Name + ".unpack");
774+
// Adjust AA metadata to new offset and size.
775+
AAMDNodes adjustedAANodes = LI.getAAMetadata().adjustForAccess(
776+
SL->getElementOffset(i),
777+
SL->getElementOffset(i).getKnownMinValue());
774778
// Propagate AA metadata. It'll still be valid on the narrowed load.
775-
L->setAAMetadata(LI.getAAMetadata());
779+
L->setAAMetadata(adjustedAANodes);
776780
copyInvariantLoadMetadata(LI, L);
777781
V = IC.Builder.CreateInsertValue(V, L, i);
778782
}

0 commit comments

Comments
 (0)