[llvm] [InstCombine] Propagate invariant.load metadata across unpacked loads (PR #152186)
    Vedant Paranjape via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Wed Aug 13 15:32:41 PDT 2025
    
    
  
================
@@ -762,8 +771,13 @@ static Instruction *unpackLoadToAggregate(InstCombinerImpl &IC, LoadInst &LI) {
           ST->getElementType(i), Ptr,
           commonAlignment(Align, SL->getElementOffset(i).getKnownMinValue()),
           Name + ".unpack");
+      // Adjust AA metadata to new offset and size.
+      AAMDNodes adjustedAANodes = LI.getAAMetadata().adjustForAccess(
+          SL->getElementOffset(i),
+          SL->getElementOffset(i).getKnownMinValue());
----------------
VedantParanjape wrote:
Sure, I will upload this as a separate patch.
https://github.com/llvm/llvm-project/pull/152186
    
    
More information about the llvm-commits
mailing list