37 lines · plain
1; RUN: opt -passes=loop-unroll -mtriple=hexagon -S < %s | FileCheck %s2; Check that the loop is peeled twice for Hexagon.3; CHECK: while.body.peel4; CHECK: while.body.peel25 6%struct.STREAM = type { %union.anon, i32, i32 }7%union.anon = type { ptr }8 9define void @function(ptr nocapture readonly %b) local_unnamed_addr {10entry:11 %bitPtr3 = getelementptr inbounds %struct.STREAM, ptr %b, i32 0, i32 212 %0 = load i32, ptr %bitPtr3, align 413 %cmp11 = icmp ult i32 %0, 3214 br i1 %cmp11, label %while.body.preheader, label %do.end15 16while.body.preheader:17 %value2 = getelementptr inbounds %struct.STREAM, ptr %b, i32 0, i32 118 %1 = load i32, ptr %value2, align 419 %2 = load ptr, ptr %b, align 420 br label %while.body21 22while.body:23 %bitPtr.014 = phi i32 [ %add, %while.body ], [ %0, %while.body.preheader ]24 %value.013 = phi i32 [ %shl, %while.body ], [ %1, %while.body.preheader ]25 %ptr.012 = phi ptr [ %incdec.ptr, %while.body ], [ %2, %while.body.preheader ]26 %add = add nuw i32 %bitPtr.014, 827 %shr = lshr i32 %value.013, 2428 %incdec.ptr = getelementptr inbounds i32, ptr %ptr.012, i32 129 store i32 %shr, ptr %ptr.012, align 430 %shl = shl i32 %value.013, 831 %cmp = icmp ult i32 %add, 1732 br i1 %cmp, label %while.body, label %do.end33 34do.end:35 ret void36}37