1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py 2; RUN: llc -mtriple=x86_64-unknown-unknown -x86-early-ifcvt -debug-only=early-ifcvt < %s 2>&1 | FileCheck %s 3; REQUIRES: asserts 4 5; This test case ensures that machine trace metrics properly calculates 6; instructions heights and the trace's critical path for the entry block when 7; MinInstr strategy is used. The behavior is demonstrated on early if conversion 8; pass. 9 10; CHECK: TBB: MinInstr trace %bb.0 --> %bb.0 --> %bb.2: 8 instrs. 30 cycles. 11; CHECK: %bb.0 12; CHECK: -> %bb.2 13 14; CHECK: FBB: MinInstr trace %bb.0 --> %bb.1 --> %bb.2: 10 instrs. 32 cycles. 15; CHECK: %bb.1 <- %bb.0 16; CHECK: -> %bb.2 17 18; CHECK: Resource length 10, minimal critical path 30 19; CHECK: If-converting 20 21define i32 @_Z3fooiidd(i32 %a, i32 %b, double %d, double %e) #0 { 22; CHECK-LABEL: _Z3fooiidd: 23; CHECK: # %bb.0: # %entry 24; CHECK-NEXT: # kill: def $esi killed $esi def $rsi 25; CHECK-NEXT: # kill: def $edi killed $edi def $rdi 26; CHECK-NEXT: leal (%rsi,%rdi), %ecx 27; CHECK-NEXT: cvttsd2si %xmm0, %eax 28; CHECK-NEXT: addl %ecx, %eax 29; CHECK-NEXT: cmpl $3, %edi 30; CHECK-NEXT: cmovll %ecx, %eax 31; CHECK-NEXT: cvttsd2si %xmm1, %ecx 32; CHECK-NEXT: cltd 33; CHECK-NEXT: idivl %ecx 34; CHECK-NEXT: retq 35entry: 36 %add = add nsw i32 %b, %a 37 %cmp = icmp sgt i32 %a, 2 38 br i1 %cmp, label %if.then, label %if.end 39 40if.then: 41 %conv = fptosi double %d to i32 42 %add1 = add nsw i32 %add, %conv 43 br label %if.end 44 45if.end: 46 %tmp.0 = phi i32 [ %add1, %if.then ], [ %add, %entry ] 47 %conv2 = fptosi double %e to i32 48 %div = sdiv i32 %tmp.0, %conv2 49 ret i32 %div 50} 51 52attributes #0 = { "tune-cpu"="generic" } 53 54