1; RUN: opt -S -loop-unroll -unroll-runtime -unroll-count=2 -verify-loop-info -pass-remarks=loop-unroll < %s 2>&1 | FileCheck %s 2 3target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" 4target triple = "x86_64-unknown-linux-gnu" 5 6; Verify that runtime-unrolling a top-level loop that has nested loops does not 7; make the unroller produce invalid loop-info. 8; CHECK: remark: {{.*}}: unrolled loop by a factor of 2 with run-time trip count 9; CHECK: @widget 10; CHECK: ret void 11define void @widget(double* %arg, double* %arg1, double* %p, i64* %q1, i64* %q2) local_unnamed_addr { 12entry: 13 br label %header.outer 14 15header.outer: ; preds = %latch.outer, %entry 16 %tmp = phi double* [ %tmp8, %latch.outer ], [ %arg, %entry ] 17 br label %header.inner 18 19header.inner: ; preds = %latch.inner, %header.outer 20 br i1 undef, label %latch.inner, label %latch.outer 21 22latch.inner: ; preds = %header.inner 23 %tmp5 = load i64, i64* %q1, align 8 24 store i64 %tmp5, i64* %q2, align 8 25 %tmp6 = icmp eq double* %p, %arg 26 br label %header.inner 27 28latch.outer: ; preds = %header.inner 29 store double 0.0, double* %p, align 8 30 %tmp8 = getelementptr inbounds double, double* %tmp, i64 1 31 %tmp9 = icmp eq double* %tmp8, %arg1 32 br i1 %tmp9, label %exit, label %header.outer 33 34exit: ; preds = %latch.outer 35 ret void 36} 37