brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.0 KiB · 916e74f Raw
73 lines · plain
1; RUN: llc -mtriple=hexagon -enable-save-restore-long -hexagon-initial-cfg-cleanup=0 < %s | FileCheck %s2 3; Check that the -long-calls feature is supported by the backend.4 5; CHECK: call ##foo6; CHECK: jump ##__restore7define i64 @test_longcall(i32 %x, i32 %y) #0 {8entry:9  %add = add nsw i32 %x, 510  %call = tail call i64 @foo(i32 %add) #111  %conv = sext i32 %y to i6412  %add1 = add nsw i64 %call, %conv13  ret i64 %add114}15 16; CHECK: jump ##foo17define i64 @test_longtailcall(i32 %x, i32 %y) #1 {18entry:19  %add = add nsw i32 %x, 520  %call = tail call i64 @foo(i32 %add) #121  ret i64 %call22}23 24; CHECK: call ##bar25define i64 @test_longnoret(i32 %x, i32 %y) #2 {26entry:27  %add = add nsw i32 %x, 528  %0 = tail call i64 @bar(i32 %add) #629  unreachable30}31 32; CHECK: call foo33; CHECK: jump ##__restore34; The restore call will still be long because of the enable-save-restore-long35; option being used.36define i64 @test_shortcall(i32 %x, i32 %y) #3 {37entry:38  %add = add nsw i32 %x, 539  %call = tail call i64 @foo(i32 %add) #140  %conv = sext i32 %y to i6441  %add1 = add nsw i64 %call, %conv42  ret i64 %add143}44 45; CHECK: jump foo46define i64 @test_shorttailcall(i32 %x, i32 %y) #4 {47entry:48  %add = add nsw i32 %x, 549  %call = tail call i64 @foo(i32 %add) #150  ret i64 %call51}52 53; CHECK: call bar54define i64 @test_shortnoret(i32 %x, i32 %y) #5 {55entry:56  %add = add nsw i32 %x, 557  %0 = tail call i64 @bar(i32 %add) #658  unreachable59}60 61declare i64 @foo(i32) #162declare i64 @bar(i32) #663 64attributes #0 = { minsize nounwind "target-cpu"="hexagonv60" "target-features"="+long-calls" }65attributes #1 = { nounwind "target-cpu"="hexagonv60" "target-features"="+long-calls" }66attributes #2 = { noreturn nounwind "target-cpu"="hexagonv60" "target-features"="+long-calls" }67 68attributes #3 = { minsize nounwind "target-cpu"="hexagonv60" "target-features"="-long-calls" }69attributes #4 = { nounwind "target-cpu"="hexagonv60" "target-features"="-long-calls" }70attributes #5 = { noreturn nounwind "target-cpu"="hexagonv60" "target-features"="-long-calls" }71 72attributes #6 = { noreturn nounwind "target-cpu"="hexagonv60" }73