[llvm-branch-commits] [llvm] [LowerMemIntrinsics] Optimize memset lowering (PR #169040)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Nov 21 05:47:36 PST 2025


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/LowerMemIntrinsics.h llvm/lib/CodeGen/PreISelIntrinsicLowering.cpp llvm/lib/Target/AMDGPU/AMDGPULowerBufferFatPointers.cpp llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp llvm/lib/Target/NVPTX/NVPTXLowerAggrCopies.cpp llvm/lib/Target/SPIRV/SPIRVPrepareFunctions.cpp llvm/lib/Transforms/Utils/LowerMemIntrinsics.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/LowerMemIntrinsics.cpp b/llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp
index c0d7dbf00..07bfceb99 100644
--- a/llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp
+++ b/llvm/lib/Transforms/Utils/LowerMemIntrinsics.cpp
@@ -933,11 +933,11 @@ static void createMemMoveLoopKnownSize(Instruction *InsertBefore,
 /// Create a Value of \p DstType that consists of a sequence of copies of
 /// \p SetValue, using bitcasts and a vector splat.
 static Value *createMemSetSplat(const DataLayout &DL, IRBuilderBase &B,
-                            Value *SetValue, Type *DstType) {
+                                Value *SetValue, Type *DstType) {
   unsigned DstSize = DL.getTypeStoreSize(DstType);
   Type *SetValueType = SetValue->getType();
   unsigned SetValueSize = DL.getTypeStoreSize(SetValueType);
-  assert(SetValueSize == DL.getTypeAllocSize(SetValueType) && 
+  assert(SetValueSize == DL.getTypeAllocSize(SetValueType) &&
          "Store size and alloc size of SetValue's type must match");
   assert(SetValueSize != 0 && DstSize % SetValueSize == 0 &&
          "DstType size must be a multiple of SetValue size");

``````````

</details>


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


More information about the llvm-branch-commits mailing list