llvm/llvm/test/CodeGen/X86/GlobalISel/legalize-phi.mir

# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=x86_64-linux-gnu -run-pass=legalizer %s -o - | FileCheck %s

--- |

  define zeroext i1 @test_i1(i32 %a, i1 zeroext %f, i1 zeroext %t) {
  entry:
    %cmp = icmp sgt i32 %a, 0
    br i1 %cmp, label %cond.true, label %cond.false

  cond.true:                                        ; preds = %entry
    br label %cond.end

  cond.false:                                       ; preds = %entry
    br label %cond.end

  cond.end:                                         ; preds = %cond.false, %cond.true
    %cond = phi i1 [ %f, %cond.true ], [ %t, %cond.false ]
    ret i1 %cond
  }

  define i8 @test_i8(i32 %a, i8 %f, i8 %t) {
  entry:
    %cmp = icmp sgt i32 %a, 0
    br i1 %cmp, label %cond.true, label %cond.false

  cond.true:                                        ; preds = %entry
    br label %cond.end

  cond.false:                                       ; preds = %entry
    br label %cond.end

  cond.end:                                         ; preds = %cond.false, %cond.true
    %cond = phi i8 [ %f, %cond.true ], [ %t, %cond.false ]
    ret i8 %cond
  }

  define i16 @test_i16(i32 %a, i16 %f, i16 %t) {
  entry:
    %cmp = icmp sgt i32 %a, 0
    br i1 %cmp, label %cond.true, label %cond.false

  cond.true:                                        ; preds = %entry
    br label %cond.end

  cond.false:                                       ; preds = %entry
    br label %cond.end

  cond.end:                                         ; preds = %cond.false, %cond.true
    %cond = phi i16 [ %f, %cond.true ], [ %t, %cond.false ]
    ret i16 %cond
  }

  define i32 @test_i32(i32 %a, i32 %f, i32 %t) {
  entry:
    %cmp = icmp sgt i32 %a, 0
    br i1 %cmp, label %cond.true, label %cond.false

  cond.true:                                        ; preds = %entry
    br label %cond.end

  cond.false:                                       ; preds = %entry
    br label %cond.end

  cond.end:                                         ; preds = %cond.false, %cond.true
    %cond = phi i32 [ %f, %cond.true ], [ %t, %cond.false ]
    ret i32 %cond
  }

  define i64 @test_i64(i32 %a, i64 %f, i64 %t) {
  entry:
    %cmp = icmp sgt i32 %a, 0
    br i1 %cmp, label %cond.true, label %cond.false

  cond.true:                                        ; preds = %entry
    br label %cond.end

  cond.false:                                       ; preds = %entry
    br label %cond.end

  cond.end:                                         ; preds = %cond.false, %cond.true
    %cond = phi i64 [ %f, %cond.true ], [ %t, %cond.false ]
    ret i64 %cond
  }

  define float @test_float(i32 %a, float %f, float %t) {
  entry:
    %cmp = icmp sgt i32 %a, 0
    br i1 %cmp, label %cond.true, label %cond.false

  cond.true:                                        ; preds = %entry
    br label %cond.end

  cond.false:                                       ; preds = %entry
    br label %cond.end

  cond.end:                                         ; preds = %cond.false, %cond.true
    %cond = phi float [ %f, %cond.true ], [ %t, %cond.false ]
    ret float %cond
  }

  define double @test_double(i32 %a, double %f, double %t) {
  entry:
    %cmp = icmp sgt i32 %a, 0
    br i1 %cmp, label %cond.true, label %cond.false

  cond.true:                                        ; preds = %entry
    br label %cond.end

  cond.false:                                       ; preds = %entry
    br label %cond.end

  cond.end:                                         ; preds = %cond.false, %cond.true
    %cond = phi double [ %f, %cond.true ], [ %t, %cond.false ]
    ret double %cond
  }

...
---
name:            test_i1
alignment:       16
legalized:       false
regBankSelected: false
tracksRegLiveness: true
registers:
  - { id: 0, class: _, preferred-register: '' }
  - { id: 1, class: _, preferred-register: '' }
  - { id: 2, class: _, preferred-register: '' }
  - { id: 3, class: _, preferred-register: '' }
  - { id: 4, class: _, preferred-register: '' }
  - { id: 5, class: _, preferred-register: '' }
  - { id: 6, class: _, preferred-register: '' }
  - { id: 7, class: _, preferred-register: '' }
  - { id: 8, class: _, preferred-register: '' }
liveins:
fixedStack:
stack:
constants:




body:             |
  ; CHECK-LABEL: name: test_i1
  ; CHECK: bb.0.entry:
  ; CHECK-NEXT:   successors: %bb.2(0x40000000), %bb.1(0x40000000)
  ; CHECK-NEXT:   liveins: $edi, $edx, $esi
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:_(s32) = COPY $edi
  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
  ; CHECK-NEXT:   [[COPY2:%[0-9]+]]:_(s32) = COPY $edx
  ; CHECK-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; CHECK-NEXT:   [[ICMP:%[0-9]+]]:_(s8) = G_ICMP intpred(sgt), [[COPY]](s32), [[C]]
  ; CHECK-NEXT:   [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s8)
  ; CHECK-NEXT:   [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32)
  ; CHECK-NEXT:   G_BRCOND [[TRUNC]](s1), %bb.2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1.cond.false:
  ; CHECK-NEXT:   successors: %bb.2(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[TRUNC2:%[0-9]+]]:_(s8) = G_TRUNC [[COPY2]](s32)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2.cond.end:
  ; CHECK-NEXT:   [[PHI:%[0-9]+]]:_(s8) = G_PHI [[TRUNC2]](s8), %bb.1, [[TRUNC1]](s8), %bb.0
  ; CHECK-NEXT:   $al = COPY [[PHI]](s8)
  ; CHECK-NEXT:   RET 0, implicit $al
  bb.1.entry:
    successors: %bb.3(0x40000000), %bb.2(0x40000000)
    liveins: $edi, $edx, $esi

    %0:_(s32) = COPY $edi
    %3:_(s32) = COPY $esi
    %1:_(s1) = G_TRUNC %3(s32)
    %4:_(s32) = COPY $edx
    %2:_(s1) = G_TRUNC %4(s32)
    %5:_(s32) = G_CONSTANT i32 0
    %6:_(s1) = G_ICMP intpred(sgt), %0(s32), %5
    G_BRCOND %6(s1), %bb.3

  bb.2.cond.false:
    successors: %bb.3(0x80000000)


  bb.3.cond.end:
    %7:_(s1) = G_PHI %2(s1), %bb.2, %1(s1), %bb.1
    %8:_(s8) = G_ANYEXT %7(s1)
    $al = COPY %8(s8)
    RET 0, implicit $al

...
---
name:            test_i8
alignment:       16
legalized:       false
regBankSelected: false
tracksRegLiveness: true
registers:
  - { id: 0, class: _, preferred-register: '' }
  - { id: 1, class: _, preferred-register: '' }
  - { id: 2, class: _, preferred-register: '' }
  - { id: 3, class: _, preferred-register: '' }
  - { id: 4, class: _, preferred-register: '' }
  - { id: 5, class: _, preferred-register: '' }
  - { id: 6, class: _, preferred-register: '' }
  - { id: 7, class: _, preferred-register: '' }
liveins:
fixedStack:
stack:
constants:



body:             |
  ; CHECK-LABEL: name: test_i8
  ; CHECK: bb.0.entry:
  ; CHECK-NEXT:   successors: %bb.2(0x40000000), %bb.1(0x40000000)
  ; CHECK-NEXT:   liveins: $edi, $edx, $esi
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:_(s32) = COPY $edi
  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
  ; CHECK-NEXT:   [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32)
  ; CHECK-NEXT:   [[COPY2:%[0-9]+]]:_(s32) = COPY $edx
  ; CHECK-NEXT:   [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY2]](s32)
  ; CHECK-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; CHECK-NEXT:   [[ICMP:%[0-9]+]]:_(s8) = G_ICMP intpred(sgt), [[COPY]](s32), [[C]]
  ; CHECK-NEXT:   [[TRUNC2:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s8)
  ; CHECK-NEXT:   G_BRCOND [[TRUNC2]](s1), %bb.2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1.cond.false:
  ; CHECK-NEXT:   successors: %bb.2(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2.cond.end:
  ; CHECK-NEXT:   [[PHI:%[0-9]+]]:_(s8) = G_PHI [[TRUNC1]](s8), %bb.1, [[TRUNC]](s8), %bb.0
  ; CHECK-NEXT:   $al = COPY [[PHI]](s8)
  ; CHECK-NEXT:   RET 0, implicit $al
  bb.1.entry:
    successors: %bb.3(0x40000000), %bb.2(0x40000000)
    liveins: $edi, $edx, $esi

    %0:_(s32) = COPY $edi
    %3:_(s32) = COPY $esi
    %1:_(s8) = G_TRUNC %3(s32)
    %4:_(s32) = COPY $edx
    %2:_(s8) = G_TRUNC %4(s32)
    %5:_(s32) = G_CONSTANT i32 0
    %6:_(s1) = G_ICMP intpred(sgt), %0(s32), %5
    G_BRCOND %6(s1), %bb.3

  bb.2.cond.false:
    successors: %bb.3(0x80000000)


  bb.3.cond.end:
    %7:_(s8) = G_PHI %2(s8), %bb.2, %1(s8), %bb.1
    $al = COPY %7(s8)
    RET 0, implicit $al

...
---
name:            test_i16
alignment:       16
legalized:       false
regBankSelected: false
tracksRegLiveness: true
registers:
  - { id: 0, class: _, preferred-register: '' }
  - { id: 1, class: _, preferred-register: '' }
  - { id: 2, class: _, preferred-register: '' }
  - { id: 3, class: _, preferred-register: '' }
  - { id: 4, class: _, preferred-register: '' }
  - { id: 5, class: _, preferred-register: '' }
  - { id: 6, class: _, preferred-register: '' }
  - { id: 7, class: _, preferred-register: '' }
liveins:
fixedStack:
stack:
constants:



body:             |
  ; CHECK-LABEL: name: test_i16
  ; CHECK: bb.0.entry:
  ; CHECK-NEXT:   successors: %bb.2(0x40000000), %bb.1(0x40000000)
  ; CHECK-NEXT:   liveins: $edi, $edx, $esi
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:_(s32) = COPY $edi
  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
  ; CHECK-NEXT:   [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32)
  ; CHECK-NEXT:   [[COPY2:%[0-9]+]]:_(s32) = COPY $edx
  ; CHECK-NEXT:   [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY2]](s32)
  ; CHECK-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; CHECK-NEXT:   [[ICMP:%[0-9]+]]:_(s8) = G_ICMP intpred(sgt), [[COPY]](s32), [[C]]
  ; CHECK-NEXT:   [[TRUNC2:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s8)
  ; CHECK-NEXT:   G_BRCOND [[TRUNC2]](s1), %bb.2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1.cond.false:
  ; CHECK-NEXT:   successors: %bb.2(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2.cond.end:
  ; CHECK-NEXT:   [[PHI:%[0-9]+]]:_(s16) = G_PHI [[TRUNC1]](s16), %bb.1, [[TRUNC]](s16), %bb.0
  ; CHECK-NEXT:   $ax = COPY [[PHI]](s16)
  ; CHECK-NEXT:   RET 0, implicit $ax
  bb.1.entry:
    successors: %bb.3(0x40000000), %bb.2(0x40000000)
    liveins: $edi, $edx, $esi

    %0:_(s32) = COPY $edi
    %3:_(s32) = COPY $esi
    %1:_(s16) = G_TRUNC %3(s32)
    %4:_(s32) = COPY $edx
    %2:_(s16) = G_TRUNC %4(s32)
    %5:_(s32) = G_CONSTANT i32 0
    %6:_(s1) = G_ICMP intpred(sgt), %0(s32), %5
    G_BRCOND %6(s1), %bb.3

  bb.2.cond.false:
    successors: %bb.3(0x80000000)


  bb.3.cond.end:
    %7:_(s16) = G_PHI %2(s16), %bb.2, %1(s16), %bb.1
    $ax = COPY %7(s16)
    RET 0, implicit $ax

...
---
name:            test_i32
alignment:       16
legalized:       false
regBankSelected: false
tracksRegLiveness: true
registers:
  - { id: 0, class: _, preferred-register: '' }
  - { id: 1, class: _, preferred-register: '' }
  - { id: 2, class: _, preferred-register: '' }
  - { id: 3, class: _, preferred-register: '' }
  - { id: 4, class: _, preferred-register: '' }
  - { id: 5, class: _, preferred-register: '' }
liveins:
fixedStack:
stack:
constants:



body:             |
  ; CHECK-LABEL: name: test_i32
  ; CHECK: bb.0.entry:
  ; CHECK-NEXT:   successors: %bb.1(0x40000000), %bb.2(0x40000000)
  ; CHECK-NEXT:   liveins: $edi, $edx, $esi
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:_(s32) = COPY $edi
  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:_(s32) = COPY $esi
  ; CHECK-NEXT:   [[COPY2:%[0-9]+]]:_(s32) = COPY $edx
  ; CHECK-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; CHECK-NEXT:   [[ICMP:%[0-9]+]]:_(s8) = G_ICMP intpred(sgt), [[COPY]](s32), [[C]]
  ; CHECK-NEXT:   [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s8)
  ; CHECK-NEXT:   G_BRCOND [[TRUNC]](s1), %bb.1
  ; CHECK-NEXT:   G_BR %bb.2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1.cond.true:
  ; CHECK-NEXT:   successors: %bb.3(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   G_BR %bb.3
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2.cond.false:
  ; CHECK-NEXT:   successors: %bb.3(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.3.cond.end:
  ; CHECK-NEXT:   [[PHI:%[0-9]+]]:_(s32) = G_PHI [[COPY1]](s32), %bb.1, [[COPY2]](s32), %bb.2
  ; CHECK-NEXT:   $eax = COPY [[PHI]](s32)
  ; CHECK-NEXT:   RET 0, implicit $eax
  bb.1.entry:
    successors: %bb.2(0x40000000), %bb.3(0x40000000)
    liveins: $edi, $edx, $esi

    %0(s32) = COPY $edi
    %1(s32) = COPY $esi
    %2(s32) = COPY $edx
    %3(s32) = G_CONSTANT i32 0
    %4(s1) = G_ICMP intpred(sgt), %0(s32), %3
    G_BRCOND %4(s1), %bb.2
    G_BR %bb.3

  bb.2.cond.true:
    successors: %bb.4(0x80000000)

    G_BR %bb.4

  bb.3.cond.false:
    successors: %bb.4(0x80000000)


  bb.4.cond.end:
    %5(s32) = G_PHI %1(s32), %bb.2, %2(s32), %bb.3
    $eax = COPY %5(s32)
    RET 0, implicit $eax

...
---
name:            test_i64
alignment:       16
legalized:       false
regBankSelected: false
tracksRegLiveness: true
registers:
  - { id: 0, class: _, preferred-register: '' }
  - { id: 1, class: _, preferred-register: '' }
  - { id: 2, class: _, preferred-register: '' }
  - { id: 3, class: _, preferred-register: '' }
  - { id: 4, class: _, preferred-register: '' }
  - { id: 5, class: _, preferred-register: '' }
liveins:
fixedStack:
stack:
constants:



body:             |
  ; CHECK-LABEL: name: test_i64
  ; CHECK: bb.0.entry:
  ; CHECK-NEXT:   successors: %bb.1(0x40000000), %bb.2(0x40000000)
  ; CHECK-NEXT:   liveins: $edi, $rdx, $rsi
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:_(s32) = COPY $edi
  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:_(s64) = COPY $rsi
  ; CHECK-NEXT:   [[COPY2:%[0-9]+]]:_(s64) = COPY $rdx
  ; CHECK-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; CHECK-NEXT:   [[ICMP:%[0-9]+]]:_(s8) = G_ICMP intpred(sgt), [[COPY]](s32), [[C]]
  ; CHECK-NEXT:   [[TRUNC:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s8)
  ; CHECK-NEXT:   G_BRCOND [[TRUNC]](s1), %bb.1
  ; CHECK-NEXT:   G_BR %bb.2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1.cond.true:
  ; CHECK-NEXT:   successors: %bb.3(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   G_BR %bb.3
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2.cond.false:
  ; CHECK-NEXT:   successors: %bb.3(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.3.cond.end:
  ; CHECK-NEXT:   [[PHI:%[0-9]+]]:_(s64) = G_PHI [[COPY1]](s64), %bb.1, [[COPY2]](s64), %bb.2
  ; CHECK-NEXT:   $rax = COPY [[PHI]](s64)
  ; CHECK-NEXT:   RET 0, implicit $rax
  bb.1.entry:
    successors: %bb.2(0x40000000), %bb.3(0x40000000)
    liveins: $edi, $rdx, $rsi

    %0(s32) = COPY $edi
    %1(s64) = COPY $rsi
    %2(s64) = COPY $rdx
    %3(s32) = G_CONSTANT i32 0
    %4(s1) = G_ICMP intpred(sgt), %0(s32), %3
    G_BRCOND %4(s1), %bb.2
    G_BR %bb.3

  bb.2.cond.true:
    successors: %bb.4(0x80000000)

    G_BR %bb.4

  bb.3.cond.false:
    successors: %bb.4(0x80000000)


  bb.4.cond.end:
    %5(s64) = G_PHI %1(s64), %bb.2, %2(s64), %bb.3
    $rax = COPY %5(s64)
    RET 0, implicit $rax

...
---
name:            test_float
alignment:       16
legalized:       false
regBankSelected: false
tracksRegLiveness: true
registers:
  - { id: 0, class: _, preferred-register: '' }
  - { id: 1, class: _, preferred-register: '' }
  - { id: 2, class: _, preferred-register: '' }
  - { id: 3, class: _, preferred-register: '' }
  - { id: 4, class: _, preferred-register: '' }
  - { id: 5, class: _, preferred-register: '' }
  - { id: 6, class: _, preferred-register: '' }
  - { id: 7, class: _, preferred-register: '' }
  - { id: 8, class: _, preferred-register: '' }
liveins:
fixedStack:
stack:
constants:



body:             |
  ; CHECK-LABEL: name: test_float
  ; CHECK: bb.0.entry:
  ; CHECK-NEXT:   successors: %bb.2(0x40000000), %bb.1(0x40000000)
  ; CHECK-NEXT:   liveins: $edi, $xmm0, $xmm1
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:_(s32) = COPY $edi
  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:_(s128) = COPY $xmm0
  ; CHECK-NEXT:   [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY1]](s128)
  ; CHECK-NEXT:   [[COPY2:%[0-9]+]]:_(s128) = COPY $xmm1
  ; CHECK-NEXT:   [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[COPY2]](s128)
  ; CHECK-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; CHECK-NEXT:   [[ICMP:%[0-9]+]]:_(s8) = G_ICMP intpred(sgt), [[COPY]](s32), [[C]]
  ; CHECK-NEXT:   [[TRUNC2:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s8)
  ; CHECK-NEXT:   G_BRCOND [[TRUNC2]](s1), %bb.2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1.cond.false:
  ; CHECK-NEXT:   successors: %bb.2(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2.cond.end:
  ; CHECK-NEXT:   [[PHI:%[0-9]+]]:_(s32) = G_PHI [[TRUNC1]](s32), %bb.1, [[TRUNC]](s32), %bb.0
  ; CHECK-NEXT:   [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[PHI]](s32)
  ; CHECK-NEXT:   $xmm0 = COPY [[ANYEXT]](s128)
  ; CHECK-NEXT:   RET 0, implicit $xmm0
  bb.1.entry:
    successors: %bb.3(0x40000000), %bb.2(0x40000000)
    liveins: $edi, $xmm0, $xmm1

    %0:_(s32) = COPY $edi
    %3:_(s128) = COPY $xmm0
    %1:_(s32) = G_TRUNC %3(s128)
    %4:_(s128) = COPY $xmm1
    %2:_(s32) = G_TRUNC %4(s128)
    %5:_(s32) = G_CONSTANT i32 0
    %6:_(s1) = G_ICMP intpred(sgt), %0(s32), %5
    G_BRCOND %6(s1), %bb.3

  bb.2.cond.false:
    successors: %bb.3(0x80000000)


  bb.3.cond.end:
    %7:_(s32) = G_PHI %2(s32), %bb.2, %1(s32), %bb.1
    %8:_(s128) = G_ANYEXT %7(s32)
    $xmm0 = COPY %8(s128)
    RET 0, implicit $xmm0

...
---
name:            test_double
alignment:       16
legalized:       false
regBankSelected: false
tracksRegLiveness: true
registers:
  - { id: 0, class: _, preferred-register: '' }
  - { id: 1, class: _, preferred-register: '' }
  - { id: 2, class: _, preferred-register: '' }
  - { id: 3, class: _, preferred-register: '' }
  - { id: 4, class: _, preferred-register: '' }
  - { id: 5, class: _, preferred-register: '' }
  - { id: 6, class: _, preferred-register: '' }
  - { id: 7, class: _, preferred-register: '' }
  - { id: 8, class: _, preferred-register: '' }
liveins:
fixedStack:
stack:
constants:



body:             |
  ; CHECK-LABEL: name: test_double
  ; CHECK: bb.0.entry:
  ; CHECK-NEXT:   successors: %bb.2(0x40000000), %bb.1(0x40000000)
  ; CHECK-NEXT:   liveins: $edi, $xmm0, $xmm1
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT:   [[COPY:%[0-9]+]]:_(s32) = COPY $edi
  ; CHECK-NEXT:   [[COPY1:%[0-9]+]]:_(s128) = COPY $xmm0
  ; CHECK-NEXT:   [[TRUNC:%[0-9]+]]:_(s64) = G_TRUNC [[COPY1]](s128)
  ; CHECK-NEXT:   [[COPY2:%[0-9]+]]:_(s128) = COPY $xmm1
  ; CHECK-NEXT:   [[TRUNC1:%[0-9]+]]:_(s64) = G_TRUNC [[COPY2]](s128)
  ; CHECK-NEXT:   [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
  ; CHECK-NEXT:   [[ICMP:%[0-9]+]]:_(s8) = G_ICMP intpred(sgt), [[COPY]](s32), [[C]]
  ; CHECK-NEXT:   [[TRUNC2:%[0-9]+]]:_(s1) = G_TRUNC [[ICMP]](s8)
  ; CHECK-NEXT:   G_BRCOND [[TRUNC2]](s1), %bb.2
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.1.cond.false:
  ; CHECK-NEXT:   successors: %bb.2(0x80000000)
  ; CHECK-NEXT: {{  $}}
  ; CHECK-NEXT: bb.2.cond.end:
  ; CHECK-NEXT:   [[PHI:%[0-9]+]]:_(s64) = G_PHI [[TRUNC1]](s64), %bb.1, [[TRUNC]](s64), %bb.0
  ; CHECK-NEXT:   [[ANYEXT:%[0-9]+]]:_(s128) = G_ANYEXT [[PHI]](s64)
  ; CHECK-NEXT:   $xmm0 = COPY [[ANYEXT]](s128)
  ; CHECK-NEXT:   RET 0, implicit $xmm0
  bb.1.entry:
    successors: %bb.3(0x40000000), %bb.2(0x40000000)
    liveins: $edi, $xmm0, $xmm1

    %0:_(s32) = COPY $edi
    %3:_(s128) = COPY $xmm0
    %1:_(s64) = G_TRUNC %3(s128)
    %4:_(s128) = COPY $xmm1
    %2:_(s64) = G_TRUNC %4(s128)
    %5:_(s32) = G_CONSTANT i32 0
    %6:_(s1) = G_ICMP intpred(sgt), %0(s32), %5
    G_BRCOND %6(s1), %bb.3

  bb.2.cond.false:
    successors: %bb.3(0x80000000)


  bb.3.cond.end:
    %7:_(s64) = G_PHI %2(s64), %bb.2, %1(s64), %bb.1
    %8:_(s128) = G_ANYEXT %7(s64)
    $xmm0 = COPY %8(s128)
    RET 0, implicit $xmm0

...