41 lines · plain
1; RUN: llc -mtriple=x86_64-unknown-unknown < %s | FileCheck %s2; RUN: llc -mtriple=x86_64-unknown-unknown -O0 < %s | FileCheck %s3; RUN: llc -mtriple=i686-unknown-unknown -mattr=+sse2 < %s | FileCheck %s4; RUN: llc -mtriple=i686-unknown-unknown -mattr=+sse2 -O0 < %s | FileCheck %s5 6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;7;; In functions with 'no_caller_saved_registers' attribute, all registers should8;; be preserved except for registers used for passing/returning arguments.9;; The test checks that function "bar" preserves xmm0 register.10;; It also checks that caller function "foo" does not store registers for callee11;; "bar". For example, there is no store/load/access to xmm registers.12;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;13 14define i32 @bar(i32 %a0, i32 %a1, i32 %a2, i32 %a3, i32 %a4, i32 %a5, i32 %a6, i32 %a7, i32 %a8) #0 {15; CHECK-LABEL: bar16; CHECK: mov{{.*}} %xmm017; CHECK: mov{{.*}} {{.*}}, %xmm018; CHECK: ret19 call void asm sideeffect "", "~{xmm0}"()20 ret i32 121}22 23define x86_intrcc void @foo(ptr byval(i8) nocapture readnone %c) {24; CHECK-LABEL: foo25; CHECK-NOT: xmm26entry:27 tail call i32 @bar(i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8) #028 ret void29}30 31; Same as foo, but rely on attribute on @bar decl, not callsite32define x86_intrcc void @baz(ptr byval(i8) nocapture readnone %c) {33; CHECK-LABEL: baz34; CHECK-NOT: xmm35entry:36 tail call i32 @bar(i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)37 ret void38}39 40attributes #0 = { "no_caller_saved_registers" }41