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 --- 40 name: test_movb_killed 41 tracksRegLiveness: true 42 liveins: 43 - { reg: '$edi' } 44 body: | 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 --- 55 name: test_movb_impuse 56 tracksRegLiveness: true 57 liveins: 58 - { reg: '$edi' } 59 body: | 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 --- 70 name: test_movb_impdef_gr64 71 tracksRegLiveness: true 72 liveins: 73 - { reg: '$edi' } 74 body: | 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 --- 85 name: test_movb_impdef_gr32 86 tracksRegLiveness: true 87 liveins: 88 - { reg: '$edi' } 89 body: | 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 --- 100 name: test_movb_impdef_gr16 101 tracksRegLiveness: true 102 liveins: 103 - { reg: '$edi' } 104 body: | 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 --- 115 name: test_movw_impdef_gr32 116 tracksRegLiveness: true 117 liveins: 118 - { reg: '$edi' } 119 body: | 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 --- 130 name: test_movw_impdef_gr64 131 tracksRegLiveness: true 132 liveins: 133 - { reg: '$edi' } 134 body: | 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