Home | History | Annotate | Download | only in LoopUnswitch
      1 ; RUN: opt -S -loop-unswitch < %s | FileCheck %s
      2 target triple = "x86_64-pc-win32"
      3 
      4 define void @f(i32 %doit, i1 %x, i1 %y) personality i32 (...)* @__CxxFrameHandler3 {
      5 entry:
      6   %tobool = icmp eq i32 %doit, 0
      7   br label %for.cond
      8 
      9 for.cond:                                         ; preds = %for.inc, %entry
     10   br i1 %x, label %for.body, label %for.end
     11 
     12 for.body:                                         ; preds = %for.cond
     13   br i1 %tobool, label %if.then, label %for.inc
     14 
     15 if.then:                                          ; preds = %for.body
     16   br i1 %y, label %for.inc, label %delete.notnull
     17 
     18 delete.notnull:                                   ; preds = %if.then
     19   invoke void @g()
     20           to label %invoke.cont unwind label %lpad
     21 
     22 invoke.cont:                                      ; preds = %delete.notnull
     23   br label %for.inc
     24 
     25 lpad:                                             ; preds = %delete.notnull
     26   %cp = cleanuppad within none []
     27   cleanupret from %cp unwind to caller
     28 
     29 for.inc:                                          ; preds = %invoke.cont, %if.then, %for.body
     30   br label %for.cond
     31 
     32 for.end:                                          ; preds = %for.cond
     33   ret void
     34 }
     35 
     36 declare void @g()
     37 
     38 declare i32 @__CxxFrameHandler3(...)
     39 
     40 ; CHECK-LABEL: define void @f(
     41 ; CHECK: cleanuppad within none []
     42 ; CHECK-NOT: cleanuppad
     43 
     44 attributes #0 = { ssp uwtable }
     45