Home | History | Annotate | Download | only in X86
      1 ; RUN: llc < %s -march=x86-64 | FileCheck %s
      2 ; CHECK: decq [[X:%rdi|%rcx]]
      3 ; CHECK-NOT: testq [[X]], [[X]]
      4 
      5 define i64 @fact2(i64 %x) {
      6 entry:
      7   br label %while.body
      8 
      9 while.body:
     10   %result.06 = phi i64 [ %mul, %while.body ], [ 1, %entry ]
     11   %x.addr.05 = phi i64 [ %dec, %while.body ], [ %x, %entry ]
     12   %mul = mul nsw i64 %result.06, %x.addr.05
     13   %dec = add nsw i64 %x.addr.05, -1
     14   %cmp = icmp sgt i64 %dec, 0
     15   br i1 %cmp, label %while.body, label %while.end.loopexit
     16 
     17 while.end.loopexit:
     18   %mul.lcssa = phi i64 [ %mul, %while.body ]
     19   br label %while.end
     20 
     21 while.end:
     22   %result.0.lcssa = phi i64 [ %mul.lcssa, %while.end.loopexit ]
     23   ret i64 %result.0.lcssa
     24 }
     25