[llvm] e8b0a16 - [X86] Add test coverage for #55714

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 4 00:20:21 PDT 2025


Author: Simon Pilgrim
Date: 2025-06-04T08:20:05+01:00
New Revision: e8b0a16f0c0126555fbb4062c715b59e3e5e727b

URL: https://github.com/llvm/llvm-project/commit/e8b0a16f0c0126555fbb4062c715b59e3e5e727b
DIFF: https://github.com/llvm/llvm-project/commit/e8b0a16f0c0126555fbb4062c715b59e3e5e727b.diff

LOG: [X86] Add test coverage for #55714

Added: 
    

Modified: 
    llvm/test/CodeGen/X86/addr-mode-matcher-3.ll

Removed: 
    


################################################################################
diff  --git a/llvm/test/CodeGen/X86/addr-mode-matcher-3.ll b/llvm/test/CodeGen/X86/addr-mode-matcher-3.ll
index 0c7275ec28677..522b42e07c6e0 100644
--- a/llvm/test/CodeGen/X86/addr-mode-matcher-3.ll
+++ b/llvm/test/CodeGen/X86/addr-mode-matcher-3.ll
@@ -98,3 +98,48 @@ define i64 @add_shl_zext(ptr %ptr, i8 %arg) nounwind {
   %sum = add i64 %val, %shl
   ret i64 %sum
 }
+
+define i32 @PR55714_i32(i32 %n, i32 %q) {
+; X86-LABEL: PR55714_i32:
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %ecx
+; X86-NEXT:    leal (,%ecx,8), %eax
+; X86-NEXT:    subl %ecx, %eax
+; X86-NEXT:    addl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    retl
+;
+; X64-LABEL: PR55714_i32:
+; X64:       # %bb.0:
+; X64-NEXT:    # kill: def $esi killed $esi def $rsi
+; X64-NEXT:    leal (,%rsi,8), %eax
+; X64-NEXT:    subl %esi, %eax
+; X64-NEXT:    addl %edi, %eax
+; X64-NEXT:    retq
+  %mul = mul i32 %q, 7
+  %add = add i32 %mul, %n
+  ret i32 %add
+}
+
+define i64 @PR55714_i64(i64 %n, i64 %q) {
+; X86-LABEL: PR55714_i64:
+; X86:       # %bb.0:
+; X86-NEXT:    movl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    leal (,%eax,8), %ecx
+; X86-NEXT:    subl %eax, %ecx
+; X86-NEXT:    movl $7, %eax
+; X86-NEXT:    mull {{[0-9]+}}(%esp)
+; X86-NEXT:    addl %ecx, %edx
+; X86-NEXT:    addl {{[0-9]+}}(%esp), %eax
+; X86-NEXT:    adcl {{[0-9]+}}(%esp), %edx
+; X86-NEXT:    retl
+;
+; X64-LABEL: PR55714_i64:
+; X64:       # %bb.0:
+; X64-NEXT:    leaq (,%rsi,8), %rax
+; X64-NEXT:    subq %rsi, %rax
+; X64-NEXT:    addq %rdi, %rax
+; X64-NEXT:    retq
+  %mul = mul i64 %q, 7
+  %add = add i64 %mul, %n
+  ret i64 %add
+}


        


More information about the llvm-commits mailing list