[llvm] Enable unaligned loads on x86 using cmpxchg (PR #142645)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 3 10:45:53 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 HEAD~1 HEAD --extensions cpp -- llvm/lib/CodeGen/AtomicExpandPass.cpp llvm/lib/Target/X86/X86ISelLowering.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/AtomicExpandPass.cpp b/llvm/lib/CodeGen/AtomicExpandPass.cpp
index de4dc63d5..6212dbffe 100644
--- a/llvm/lib/CodeGen/AtomicExpandPass.cpp
+++ b/llvm/lib/CodeGen/AtomicExpandPass.cpp
@@ -246,7 +246,8 @@ static bool canLowerAtomicAsUnaligned(const TargetLowering *TLI, Inst *I) {
   Align Alignment = I->getAlign();
 
   // X86 we can do unaligned loads
-  return Size <= TLI->getMaxAtomicSizeInBitsSupported() / 8 && (Alignment < Size);
+  return Size <= TLI->getMaxAtomicSizeInBitsSupported() / 8 &&
+         (Alignment < Size);
 }
 
 bool AtomicExpandImpl::processAtomicInstr(Instruction *I) {

``````````

</details>


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


More information about the llvm-commits mailing list