Home | History | Annotate | Download | only in LoopUnroll
      1 ; RUN: opt -S -loop-unroll %s | FileCheck %s
      2 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
      3 target triple = "x86_64-pc-windows-msvc18.0.0"
      4 
      5 define void @test1() personality i32 (...)* @__CxxFrameHandler3 {
      6 entry:
      7   br label %for.body
      8 
      9 for.body:                                         ; preds = %entry, %for.inc
     10   %phi = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
     11   invoke void @callee(i32 %phi)
     12           to label %for.inc unwind label %ehcleanup
     13 
     14 for.inc:                                          ; preds = %for.body
     15   %inc = add nuw nsw i32 %phi, 1
     16   %cmp = icmp slt i32 %inc, 3
     17   br i1 %cmp, label %for.body, label %for.cond.cleanup
     18 
     19 for.cond.cleanup:                                 ; preds = %for.inc
     20   call void @dtor()
     21   ret void
     22 
     23 ehcleanup:                                        ; preds = %for.body
     24   %cp = cleanuppad within none []
     25   call void @dtor() [ "funclet"(token %cp) ]
     26   cleanupret from %cp unwind to caller
     27 }
     28 
     29 ; CHECK-LABEL: define void @test1(
     30 ; CHECK: invoke void @callee(i32 0
     31 
     32 ; CHECK: invoke void @callee(i32 1
     33 
     34 ; CHECK: invoke void @callee(i32 2
     35 
     36 declare void @callee(i32)
     37 
     38 declare i32 @__CxxFrameHandler3(...)
     39 
     40 declare void @dtor()
     41