1# RUN: llc -run-pass x86-fixup-bw-insts -mtriple=x86_64-- -o - %s | FileCheck %s 2 3# Verify that we correctly deal with the flag edge cases when replacing 4# copies by bigger copies, which is a pretty unusual transform. 5 6--- | 7 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128" 8 9 define i8 @test_movb_killed(i8 %a0) { 10 ret i8 %a0 11 } 12 13 define i8 @test_movb_impuse(i8 %a0) { 14 ret i8 %a0 15 } 16 17 define i8 @test_movb_impdef_gr64(i8 %a0) { 18 ret i8 %a0 19 } 20 21 define i8 @test_movb_impdef_gr32(i8 %a0) { 22 ret i8 %a0 23 } 24 25 define i8 @test_movb_impdef_gr16(i8 %a0) { 26 ret i8 %a0 27 } 28 29 define i16 @test_movw_impdef_gr32(i16 %a0) { 30 ret i16 %a0 31 } 32 33 define i16 @test_movw_impdef_gr64(i16 %a0) { 34 ret i16 %a0 35 } 36 37... 38 39--- 40name: test_movb_killed 41tracksRegLiveness: true 42liveins: 43 - { reg: '$edi' } 44body: | 45 bb.0 (%ir-block.0): 46 liveins: $edi 47 48 ; CHECK: $eax = MOV32rr undef $edi, implicit $dil 49 $al = MOV8rr killed $dil 50 RETQ killed $al 51 52... 53 54--- 55name: test_movb_impuse 56tracksRegLiveness: true 57liveins: 58 - { reg: '$edi' } 59body: | 60 bb.0 (%ir-block.0): 61 liveins: $edi 62 63 ; CHECK: $eax = MOV32rr undef $edi, implicit $dil 64 $al = MOV8rr $dil, implicit $edi 65 RETQ killed $al 66 67... 68 69--- 70name: test_movb_impdef_gr64 71tracksRegLiveness: true 72liveins: 73 - { reg: '$edi' } 74body: | 75 bb.0 (%ir-block.0): 76 liveins: $edi 77 78 ; CHECK: $eax = MOV32rr undef $edi, implicit $dil, implicit-def $rax 79 $al = MOV8rr $dil, implicit-def $rax 80 RETQ killed $al 81 82... 83 84--- 85name: test_movb_impdef_gr32 86tracksRegLiveness: true 87liveins: 88 - { reg: '$edi' } 89body: | 90 bb.0 (%ir-block.0): 91 liveins: $edi 92 93 ; CHECK: $eax = MOV32rr undef $edi, implicit $dil 94 $al = MOV8rr $dil, implicit-def $eax 95 RETQ killed $al 96 97... 98 99--- 100name: test_movb_impdef_gr16 101tracksRegLiveness: true 102liveins: 103 - { reg: '$edi' } 104body: | 105 bb.0 (%ir-block.0): 106 liveins: $edi 107 108 ; CHECK: $eax = MOV32rr undef $edi, implicit $dil 109 $al = MOV8rr $dil, implicit-def $ax 110 RETQ killed $al 111 112... 113 114--- 115name: test_movw_impdef_gr32 116tracksRegLiveness: true 117liveins: 118 - { reg: '$edi' } 119body: | 120 bb.0 (%ir-block.0): 121 liveins: $edi 122 123 ; CHECK: $eax = MOV32rr undef $edi, implicit $di 124 $ax = MOV16rr $di, implicit-def $eax 125 RETQ killed $ax 126 127... 128 129--- 130name: test_movw_impdef_gr64 131tracksRegLiveness: true 132liveins: 133 - { reg: '$edi' } 134body: | 135 bb.0 (%ir-block.0): 136 liveins: $edi 137 138 ; CHECK: $eax = MOV32rr undef $edi, implicit $di, implicit-def $rax 139 $ax = MOV16rr $di, implicit-def $rax 140 RETQ killed $ax 141 142... 143