brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · 83e6da5 Raw
34 lines · plain
1; RUN: llc -O1 -regalloc=greedy -mtriple=x86_64-apple-macosx < %s -o - | FileCheck %s2; Check that last chance split (RAGreedy::tryInstructonSplit) just split3; when this is beneficial, otherwise we end up with uncoalesced copies.4; <rdar://problem/15570057> 5 6target datalayout = "e-i64:64-f80:128-s:64-n8:16:32:64-S128"7 8@f = external constant ptr9 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: movq17; CHECK: callq *[[F_ADDR]]18; Check that we do not have useless split points before each call.19; CHECK-NOT: movq20; CHECK: callq *[[F_ADDR]]21; Last call is a tail call, thus the address of the function cannot use22; 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]]26define void @test(i32 %a, i32 %b, i32 %c) {27entry:28  %fct_f = load ptr, ptr @f, align 829  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 void33}34