87 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=i686-- -mattr=+slow-3ops-lea | FileCheck %s --check-prefix=X863; RUN: llc < %s -mtriple=i686-- -mattr=-slow-3ops-lea | FileCheck %s --check-prefix=X864; RUN: llc < %s -mtriple=x86_64-- -mattr=+slow-3ops-lea | FileCheck %s --check-prefix=X645; RUN: llc < %s -mtriple=x86_64-- -mattr=-slow-3ops-lea | FileCheck %s --check-prefix=X646 7; )32-a)-b --> 32-(a+b) --> -(a+b)+32 --> -((a+b)-32) -> -(a+b+(-32))8 9define i32 @t0(i32 %a, i32 %b) {10; X86-LABEL: t0:11; X86: # %bb.0:12; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx13; X86-NEXT: addl {{[0-9]+}}(%esp), %ecx14; X86-NEXT: movl $32, %eax15; X86-NEXT: subl %ecx, %eax16; X86-NEXT: retl17;18; X64-LABEL: t0:19; X64: # %bb.0:20; X64-NEXT: addl %esi, %edi21; X64-NEXT: movl $32, %eax22; X64-NEXT: subl %edi, %eax23; X64-NEXT: retq24 %t0 = sub i32 32, %a25 %r = sub i32 %t0, %b26 ret i32 %r27}28define i32 @t1(i32 %a, i32 %b) {29; X86-LABEL: t1:30; X86: # %bb.0:31; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx32; X86-NEXT: addl {{[0-9]+}}(%esp), %ecx33; X86-NEXT: movl $32, %eax34; X86-NEXT: subl %ecx, %eax35; X86-NEXT: retl36;37; X64-LABEL: t1:38; X64: # %bb.0:39; X64-NEXT: addl %esi, %edi40; X64-NEXT: movl $32, %eax41; X64-NEXT: subl %edi, %eax42; X64-NEXT: retq43 %t0 = add i32 %a, %b44 %r = sub i32 32, %t045 ret i32 %r46}47define i32 @t2(i32 %a, i32 %b) {48; X86-LABEL: t2:49; X86: # %bb.0:50; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx51; X86-NEXT: addl {{[0-9]+}}(%esp), %ecx52; X86-NEXT: movl $32, %eax53; X86-NEXT: subl %ecx, %eax54; X86-NEXT: retl55;56; X64-LABEL: t2:57; X64: # %bb.0:58; X64-NEXT: addl %esi, %edi59; X64-NEXT: movl $32, %eax60; X64-NEXT: subl %edi, %eax61; X64-NEXT: retq62 %t0 = add i32 %a, %b63 %t1 = sub i32 0, %t064 %r = add i32 %t1, 3265 ret i32 %r66}67define i32 @t3(i32 %a, i32 %b) {68; X86-LABEL: t3:69; X86: # %bb.0:70; X86-NEXT: movl {{[0-9]+}}(%esp), %ecx71; X86-NEXT: addl {{[0-9]+}}(%esp), %ecx72; X86-NEXT: movl $32, %eax73; X86-NEXT: subl %ecx, %eax74; X86-NEXT: retl75;76; X64-LABEL: t3:77; X64: # %bb.0:78; X64-NEXT: addl %esi, %edi79; X64-NEXT: movl $32, %eax80; X64-NEXT: subl %edi, %eax81; X64-NEXT: retq82 %t0 = add i32 %a, %b83 %t1 = sub i32 %t0, 3284 %r = sub i32 0, %t185 ret i32 %r86}87