Rong Xu | 661ffe1 | 2017-03-17 20:05:13 +0000 | [diff] [blame] | 1 | ; RUN: opt < %s -pgo-instr-gen -instrprof -S | FileCheck %s |
| 2 | ; RUN: opt <%s -passes=pgo-instr-gen,instrprof -S | FileCheck %s |
| 3 | target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" |
| 4 | target triple = "x86_64-unknown-linux-gnu" |
| 5 | |
| 6 | define void @foo(i8* %dst, i8* %src, i32* %a, i32 %n) { |
| 7 | entry: |
| 8 | br label %for.cond |
| 9 | |
| 10 | for.cond: |
| 11 | %i.0 = phi i32 [ 0, %entry ], [ %add, %for.cond1 ] |
| 12 | %cmp = icmp slt i32 %i.0, %n |
| 13 | br i1 %cmp, label %for.cond1, label %for.end6 |
| 14 | |
| 15 | for.cond1: |
| 16 | %j.0 = phi i32 [ %inc, %for.body3 ], [ 0, %for.cond ] |
| 17 | %idx.ext = sext i32 %i.0 to i64 |
| 18 | %add.ptr = getelementptr inbounds i32, i32* %a, i64 %idx.ext |
| 19 | %0 = load i32, i32* %add.ptr, align 4 |
| 20 | %cmp2 = icmp slt i32 %j.0, %0 |
| 21 | %add = add nsw i32 %i.0, 1 |
| 22 | br i1 %cmp2, label %for.body3, label %for.cond |
| 23 | |
| 24 | for.body3: |
| 25 | %conv = sext i32 %add to i64 |
| 26 | ; CHECK: call void @__llvm_profile_instrument_range(i64 %conv, i8* bitcast ({ i64, i64, i64*, i8*, i8*, i32, [2 x i16] }* @__profd_foo to i8*), i32 0, i64 0, i64 8, i64 8192) |
Daniel Neilson | 1e68724 | 2018-01-19 17:13:12 +0000 | [diff] [blame] | 27 | call void @llvm.memcpy.p0i8.p0i8.i64(i8* %dst, i8* %src, i64 %conv, i1 false) |
Rong Xu | 661ffe1 | 2017-03-17 20:05:13 +0000 | [diff] [blame] | 28 | %inc = add nsw i32 %j.0, 1 |
| 29 | br label %for.cond1 |
| 30 | |
| 31 | for.end6: |
| 32 | ret void |
| 33 | } |
| 34 | |
Daniel Neilson | 1e68724 | 2018-01-19 17:13:12 +0000 | [diff] [blame] | 35 | declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) |