[llvm] [ExpandMemCmp] Optimize ExpandMemCmp to reduce instruction count on x86 (PR #69609)

via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 19 08:55:47 PDT 2023


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 21e1b13f3384b875bd2205a736570320cb020f3e 67917cd9a679e7d0247b790d01cf8d13acef12bd -- llvm/lib/CodeGen/ExpandMemCmp.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/ExpandMemCmp.cpp b/llvm/lib/CodeGen/ExpandMemCmp.cpp
index 40fbe877ab7a..22f8248f0185 100644
--- a/llvm/lib/CodeGen/ExpandMemCmp.cpp
+++ b/llvm/lib/CodeGen/ExpandMemCmp.cpp
@@ -316,8 +316,8 @@ MemCmpExpansion::LoadPair MemCmpExpansion::getLoadPair(Type *LoadSizeType,
   // Swap bytes if required.
   if (NeedsBSwap) {
     Type *BSwapType = CmpSizeType ? CmpSizeType : LoadSizeType;
-    Function *Bswap = Intrinsic::getDeclaration(CI->getModule(),
-                                                Intrinsic::bswap, BSwapType);
+    Function *Bswap =
+        Intrinsic::getDeclaration(CI->getModule(), Intrinsic::bswap, BSwapType);
     Lhs = Builder.CreateCall(Bswap, Lhs);
     Rhs = Builder.CreateCall(Bswap, Rhs);
   }

``````````

</details>


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


More information about the llvm-commits mailing list