[llvm] [X86] Fix typo: QWORD alignment is greater than 4, not 8 (PR #87819)

via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 5 11:57:49 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-x86

Author: AtariDreams (AtariDreams)

<details>
<summary>Changes</summary>

This probably inhibited a lot of optimizations. EmitTargetCodeForMemcpy does not have this problem, luckily.

---
Full diff: https://github.com/llvm/llvm-project/pull/87819.diff


1 Files Affected:

- (modified) llvm/lib/Target/X86/X86SelectionDAGInfo.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp b/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp
index 7c630a2b0da080..bc5cb5934454ce 100644
--- a/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp
+++ b/llvm/lib/Target/X86/X86SelectionDAGInfo.cpp
@@ -86,7 +86,7 @@ SDValue X86SelectionDAGInfo::EmitTargetCodeForMemset(
       ValReg = X86::EAX;
       Val = (Val << 8)  | Val;
       Val = (Val << 16) | Val;
-      if (Subtarget.is64Bit() && Alignment > Align(8)) { // QWORD aligned
+      if (Subtarget.is64Bit() && Alignment > Align(4)) { // QWORD aligned
         AVT = MVT::i64;
         ValReg = X86::RAX;
         Val = (Val << 32) | Val;

``````````

</details>


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


More information about the llvm-commits mailing list