30 lines · plain
1; RUN: opt < %s -S -passes=loop-unroll -unroll-max-iteration-count-to-analyze=100 -unroll-threshold=10 -unroll-max-percent-threshold-boost=200 | FileCheck %s2; RUN: opt < %s -S -passes='require<opt-remark-emit>,loop(loop-unroll-full)' -unroll-max-iteration-count-to-analyze=100 -unroll-threshold=10 -unroll-max-percent-threshold-boost=200 | FileCheck %s3target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"4 5; When examining gep-instructions we shouldn't consider them simplified if the6; corresponding memory access isn't simplified. Doing the opposite might bias7; our estimate, so that we might decide to unroll even a simple memcpy loop.8;9; Thus, the following loop shouldn't be unrolled:10; CHECK-LABEL: @not_simplified_geps11; CHECK: br i1 %12; CHECK: ret void13define void @not_simplified_geps(ptr noalias %b, ptr noalias %c) {14entry:15 br label %for.body16 17for.body:18 %iv.0 = phi i64 [ 0, %entry ], [ %iv.1, %for.body ]19 %arrayidx1 = getelementptr inbounds i32, ptr %b, i64 %iv.020 %x1 = load i32, ptr %arrayidx1, align 421 %arrayidx2 = getelementptr inbounds i32, ptr %c, i64 %iv.022 store i32 %x1, ptr %arrayidx2, align 423 %iv.1 = add nuw nsw i64 %iv.0, 124 %exitcond = icmp eq i64 %iv.1, 1025 br i1 %exitcond, label %for.end, label %for.body26 27for.end:28 ret void29}30