Skip to content

Commit 470e93b

Browse files
committed
[X86] Fix typo: QWORD alignment is greater than 4, not 8
Align(8) is QWORD aligned, but this was checking to see f alignment was higher than that, which it is not.
1 parent 3781e24 commit 470e93b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

llvm/lib/Target/X86/X86SelectionDAGInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ SDValue X86SelectionDAGInfo::EmitTargetCodeForMemset(
8686
ValReg = X86::EAX;
8787
Val = (Val << 8) | Val;
8888
Val = (Val << 16) | Val;
89-
if (Subtarget.is64Bit() && Alignment > Align(8)) { // QWORD aligned
89+
if (Subtarget.is64Bit() && Alignment > Align(4)) { // QWORD aligned
9090
AVT = MVT::i64;
9191
ValReg = X86::RAX;
9292
Val = (Val << 32) | Val;

llvm/test/CodeGen/X86/memset-minsize.ll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,10 @@ entry:
139139
define void @small_memset_to_rep_stos_64(ptr %ptr) minsize nounwind {
140140
; CHECK-LABEL: small_memset_to_rep_stos_64:
141141
; CHECK: # %bb.0: # %entry
142-
; CHECK-NEXT: pushq $32
142+
; CHECK-NEXT: pushq $16
143143
; CHECK-NEXT: popq %rcx
144144
; CHECK-NEXT: xorl %eax, %eax
145-
; CHECK-NEXT: rep;stosl %eax, %es:(%rdi)
145+
; CHECK-NEXT: rep;stosq %rax, %es:(%rdi)
146146
; CHECK-NEXT: retq
147147
entry:
148148
call void @llvm.memset.p0.i64(ptr align 8 %ptr, i8 0, i64 128, i1 false)

0 commit comments

Comments
 (0)