1 ; RUN: llc -mtriple=i686-unknown-linux-gnu -enable-misched=false < %s | FileCheck %s
3 define fastcc i8 @fold32to8(i32 %add, i8 %spill) {
4 ; CHECK-LABEL: fold32to8:
5 ; CHECK: movl %ecx, (%esp) # 4-byte Spill
6 ; CHECK: subb (%esp), %dl # 1-byte Folded Reload
8 tail call void asm sideeffect "", "~{eax},~{ebx},~{ecx},~{edi},~{esi},~{ebp},~{dirflag},~{fpsr},~{flags}"()
9 %trunc = trunc i32 %add to i8
10 %sub = sub i8 %spill, %trunc
14 ; Do not fold a 1-byte store into a 4-byte spill slot
15 define fastcc i8 @nofold(i32 %add, i8 %spill) {
16 ; CHECK-LABEL: nofold:
17 ; CHECK: movl %edx, (%esp) # 4-byte Spill
18 ; CHECK: movl (%esp), %eax # 4-byte Reload
19 ; CHECK: subb %cl, %al
21 tail call void asm sideeffect "", "~{eax},~{ebx},~{edx},~{edi},~{esi},~{ebp},~{dirflag},~{fpsr},~{flags}"()
22 %trunc = trunc i32 %add to i8
23 %sub = sub i8 %spill, %trunc