xref: /llvm-project/llvm/test/CodeGen/X86/xray-loop-detection.ll (revision e6cdef187ed37468c14c53723c58cbde3e1341db)
1; RUN: llc -mtriple=x86_64-unknown-linux-gnu < %s | FileCheck %s
2; RUN: llc -mtriple=x86_64-darwin-unknown    < %s | FileCheck %s
3
4define i32 @foo(i32 %i) nounwind noinline uwtable "xray-instruction-threshold"="10" {
5entry:
6  br label %Test
7Test:
8  %indvar = phi i32 [0, %entry], [%nextindvar, %Inc]
9  %cond = icmp eq i32 %indvar, %i
10  br i1 %cond, label %Exit, label %Inc
11Inc:
12  %nextindvar = add i32 %indvar, 1
13  br label %Test
14Exit:
15  %retval = phi i32 [%indvar, %Test]
16  ret i32 %retval
17}
18
19; CHECK-LABEL: xray_sled_0:
20; CHECK-NEXT:  .ascii "\353\t"
21; CHECK-NEXT:  nopw 512(%rax,%rax)
22
23