pr18861.ll 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. ; RUN: opt < %s -loop-unroll -indvars -disable-output
  2. @b = external global i32, align 4
  3. ; Function Attrs: nounwind uwtable
  4. define void @fn1() #0 {
  5. entry:
  6. br label %for.cond1thread-pre-split
  7. for.cond1thread-pre-split: ; preds = %for.inc8, %entry
  8. %storemerge1 = phi i32 [ 0, %entry ], [ %inc9, %for.inc8 ]
  9. br i1 undef, label %for.inc8, label %for.cond2.preheader.lr.ph
  10. for.cond2.preheader.lr.ph: ; preds = %for.cond1thread-pre-split
  11. br label %for.cond2.preheader
  12. for.cond2.preheader: ; preds = %for.inc5, %for.cond2.preheader.lr.ph
  13. br label %for.cond2
  14. for.cond2: ; preds = %for.body3, %for.cond2.preheader
  15. %storemerge = phi i32 [ %add, %for.body3 ], [ 0, %for.cond2.preheader ]
  16. %cmp = icmp slt i32 %storemerge, 1
  17. br i1 %cmp, label %for.body3, label %for.inc5
  18. for.body3: ; preds = %for.cond2
  19. %tobool4 = icmp eq i32 %storemerge, 0
  20. %add = add nsw i32 %storemerge, 1
  21. br i1 %tobool4, label %for.cond2, label %if.then
  22. if.then: ; preds = %for.body3
  23. store i32 %storemerge1, i32* @b, align 4
  24. ret void
  25. for.inc5: ; preds = %for.cond2
  26. br i1 undef, label %for.cond1.for.inc8_crit_edge, label %for.cond2.preheader
  27. for.cond1.for.inc8_crit_edge: ; preds = %for.inc5
  28. br label %for.inc8
  29. for.inc8: ; preds = %for.cond1.for.inc8_crit_edge, %for.cond1thread-pre-split
  30. %inc9 = add nsw i32 %storemerge1, 1
  31. br label %for.cond1thread-pre-split
  32. }