[llvm] InferAddressSpaces: Factor replacement loop into function [NFC] (PR #104430)

via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 20 04:30:34 PDT 2024


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 7022498ac2f236e411e8a0f9a48669e754000a4b b75da36eb4afe09b078760108c45be41cab6facd --extensions cpp -- llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
index 0d580a0e74..566cdc51f6 100644
--- a/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
+++ b/llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp
@@ -1227,7 +1227,7 @@ void InferAddressSpacesImpl::performPointerReplacement(
       if (isSafeToCastConstAddrSpace(KOtherSrc, NewAS)) {
         Cmp->setOperand(SrcIdx, NewV);
         Cmp->setOperand(OtherIdx, ConstantExpr::getAddrSpaceCast(
-                          KOtherSrc, NewV->getType()));
+                                      KOtherSrc, NewV->getType()));
         return;
       }
     }
@@ -1259,7 +1259,7 @@ void InferAddressSpacesImpl::performPointerReplacement(
       ++InsertPos;
     // This instruction may contain multiple uses of V, update them all.
     CurUser->replaceUsesOfWith(
-      V, new AddrSpaceCastInst(NewV, V->getType(), "", InsertPos));
+        V, new AddrSpaceCastInst(NewV, V->getType(), "", InsertPos));
   } else {
     CurUserI->replaceUsesOfWith(
         V, ConstantExpr::getAddrSpaceCast(cast<Constant>(NewV), V->getType()));

``````````

</details>


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


More information about the llvm-commits mailing list