[llvm] [BPF] Handle certain mem intrinsic functions with addr-space arguments (PR #160025)

via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 21 20:37:17 PDT 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 cpp -- llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
``````````

: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/Target/BPF/BPFCheckAndAdjustIR.cpp b/llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
index 4fbd83d70..464123185 100644
--- a/llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
+++ b/llvm/lib/Target/BPF/BPFCheckAndAdjustIR.cpp
@@ -576,8 +576,8 @@ bool BPFCheckAndAdjustIR::insertASpaceCasts(Module &M) {
 
         // Check memset/memcpy/memmove
         Intrinsic::ID ID = Callee->getIntrinsicID();
-        bool IsSet  = ID == Intrinsic::memset;
-        bool IsCpy  = ID == Intrinsic::memcpy;
+        bool IsSet = ID == Intrinsic::memset;
+        bool IsCpy = ID == Intrinsic::memcpy;
         bool IsMove = ID == Intrinsic::memmove;
         if (!IsSet && !IsCpy && !IsMove)
           continue;
@@ -586,7 +586,7 @@ bool BPFCheckAndAdjustIR::insertASpaceCasts(Module &M) {
           Value *V = CI->getArgOperand(ArgIdx);
           if (auto *PTy = dyn_cast<PointerType>(V->getType()))
             return PTy->getAddressSpace() != 0;
-           return false;
+          return false;
         };
 
         // For memset: only dest is a pointer; for memcpy/memmove: dest & src.

``````````

</details>


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


More information about the llvm-commits mailing list