[llvm] [InstCombine] Preserve store metadata when unpacking aggregate stores (PR #208177)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 8 04:01:52 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- llvm/include/llvm/Transforms/Utils/Local.h llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp llvm/lib/Transforms/Scalar/SROA.cpp llvm/lib/Transforms/Utils/Local.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index fc1e57456..04a57c564 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -3187,9 +3187,9 @@ void llvm::copyMetadataForLoad(LoadInst &Dest, const LoadInst &Source) {
   }
 }
 
-void llvm::copyMetadataForSubAccess(Instruction &Dest, const Instruction &Source,
-                                    uint64_t Offset, Type *AccessTy,
-                                    const DataLayout &DL) {
+void llvm::copyMetadataForSubAccess(Instruction &Dest,
+                                    const Instruction &Source, uint64_t Offset,
+                                    Type *AccessTy, const DataLayout &DL) {
   // Metadata that describes a property of the memory access itself (not the
   // exact bytes touched) remains valid for a narrower sub-access, so copy it
   // directly.

``````````

</details>


https://github.com/llvm/llvm-project/pull/208177


More information about the llvm-commits mailing list