brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.8 KiB · b0f4385 Raw
49 lines · plain
1; RUN: opt -passes=debugify,loop-unroll -mcpu=znver3 -pass-remarks=loop-unroll -pass-remarks-analysis=loop-unroll < %s -S 2>&1 | FileCheck --check-prefixes=ALL,UNROLL %s2; RUN: opt -passes=debugify,loop-unroll -mcpu=znver3 -pass-remarks=TTI -pass-remarks-analysis=TTI  < %s -S 2>&1 | FileCheck --check-prefixes=ALL,TTI %s3; RUN: opt -passes=debugify,loop-unroll -mcpu=znver4 -pass-remarks=loop-unroll -pass-remarks-analysis=loop-unroll < %s -S 2>&1 | FileCheck --check-prefixes=ALL,UNROLL %s4; RUN: opt -passes=debugify,loop-unroll -mcpu=znver5 -pass-remarks=loop-unroll -pass-remarks-analysis=loop-unroll < %s -S 2>&1 | FileCheck --check-prefixes=ALL,UNROLL %s5 6 7target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"8target triple = "x86_64-unknown-linux-gnu"9 10; TTI: remark: <stdin>:7:1: advising against unrolling the loop because it contains a call11; UNROLL: remark: <stdin>:14:1: unrolled loop by a factor of 8 with run-time trip count12 13define void @contains_external_call(i32 %count) {14; ALL-LABEL: @contains_external_call(15; ALL-NOT: unroll16entry:17  %cmp.not3 = icmp eq i32 %count, 018  br i1 %cmp.not3, label %for.cond.cleanup, label %for.body19 20for.body:21  %i.04 = phi i32 [ %inc, %for.body ], [ 0, %entry ]22  tail call void @sideeffect()23  %inc = add nuw nsw i32 %i.04, 124  %cmp.not = icmp eq i32 %inc, %count25  br i1 %cmp.not, label %for.cond.cleanup, label %for.body26 27for.cond.cleanup:28  ret void29}30 31declare void @sideeffect()32 33define i32 @no_external_calls(i32 %count) {34; ALL-LABEL: @no_external_calls(35; ALL: unroll36entry:37  %cmp.not5 = icmp eq i32 %count, 038  br i1 %cmp.not5, label %for.end, label %for.body39 40for.body:41  %i.06 = phi i32 [ %inc, %for.body ], [ 0, %entry ]42  %inc = add nuw nsw i32 %i.06, 143  %cmp.not = icmp eq i32 %inc, %count44  br i1 %cmp.not, label %for.end, label %for.body45 46for.end:47  ret i32 %count48}49