Home | History | Annotate | Download | only in X86
      1 ; RUN: llc -O1 -regalloc=greedy -mtriple=x86_64-apple-macosx -march x86-64  < %s -o - | FileCheck %s
      2 ; Check that last chance split (RAGreedy::tryInstructonSplit) just split
      3 ; when this is beneficial, otherwise we end up with uncoalesced copies.
      4 ; <rdar://problem/15570057> 
      5 
      6 target datalayout = "e-i64:64-f80:128-s:64-n8:16:32:64-S128"
      7 
      8 @f = external constant void (i32)*
      9 
     10 ; CHECK-LABEL: test:
     11 ; Get the address of f in the GOT.
     12 ; CHECK: movq _f@{{[^,]+}}, [[F_ENTRY_ADDR:%[a-z0-9]+]]
     13 ; Read the actual address of f.
     14 ; CHECK: movq ([[F_ENTRY_ADDR]]), [[F_ADDR:%[a-z0-9]+]]
     15 ; Check that we do not have useless split points before each call.
     16 ; CHECK-NOT: movq
     17 ; CHECK: callq *[[F_ADDR]]
     18 ; Check that we do not have useless split points before each call.
     19 ; CHECK-NOT: movq
     20 ; CHECK: callq *[[F_ADDR]]
     21 ; Last call is a tail call, thus the address of the function cannot use
     22 ; a callee saved register.
     23 ; CHECK: movq [[F_ADDR]], [[F_ADDR_TC:%[a-z0-9]+]]
     24 ; CHECK: popq [[F_ADDR]]
     25 ; CHECK: jmpq *[[F_ADDR_TC]]
     26 define void @test(i32 %a, i32 %b, i32 %c) {
     27 entry:
     28   %fct_f = load void (i32)*, void (i32)** @f, align 8
     29   tail call void %fct_f(i32 %a)
     30   tail call void %fct_f(i32 %b)
     31   tail call void %fct_f(i32 %c)
     32   ret void
     33 }
     34