brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · 96080d2 Raw
53 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc < %s -mtriple=x86_64-- | FileCheck %s3 4; LSR previously eliminated the sitofp by introducing an induction5; variable which stepped by a bogus ((double)UINT32_C(-1)). It's theoretically6; possible to eliminate the sitofp using a proper -1.0 step though; this7; test should be changed if that is done.8 9define void @foo(i32 %N) nounwind {10; CHECK-LABEL: foo:11; CHECK:       # %bb.0: # %entry12; CHECK-NEXT:    testl %edi, %edi13; CHECK-NEXT:    js .LBB0_114; CHECK-NEXT:  # %bb.4: # %return15; CHECK-NEXT:    retq16; CHECK-NEXT:  .LBB0_1: # %bb.preheader17; CHECK-NEXT:    pushq %rbp18; CHECK-NEXT:    pushq %rbx19; CHECK-NEXT:    pushq %rax20; CHECK-NEXT:    movl %edi, %ebx21; CHECK-NEXT:    xorl %ebp, %ebp22; CHECK-NEXT:    .p2align 423; CHECK-NEXT:  .LBB0_2: # %bb24; CHECK-NEXT:    # =>This Inner Loop Header: Depth=125; CHECK-NEXT:    xorps %xmm0, %xmm026; CHECK-NEXT:    cvtsi2sd %ebp, %xmm027; CHECK-NEXT:    callq bar@PLT28; CHECK-NEXT:    decl %ebp29; CHECK-NEXT:    cmpl %ebp, %ebx30; CHECK-NEXT:    jne .LBB0_231; CHECK-NEXT:  # %bb.3:32; CHECK-NEXT:    addq $8, %rsp33; CHECK-NEXT:    popq %rbx34; CHECK-NEXT:    popq %rbp35; CHECK-NEXT:    retq36entry:37  %0 = icmp slt i32 %N, 0                         ; <i1> [#uses=1]38  br i1 %0, label %bb, label %return39 40bb:                                               ; preds = %bb, %entry41  %i.03 = phi i32 [ 0, %entry ], [ %2, %bb ]      ; <i32> [#uses=2]42  %1 = sitofp i32 %i.03 to double                  ; <double> [#uses=1]43  tail call void @bar(double %1) nounwind44  %2 = add nsw i32 %i.03, -1                       ; <i32> [#uses=2]45  %exitcond = icmp eq i32 %2, %N                  ; <i1> [#uses=1]46  br i1 %exitcond, label %return, label %bb47 48return:                                           ; preds = %bb, %entry49  ret void50}51 52declare void @bar(double)53