43 lines · plain
1; RUN: opt < %s -loop-reduce -S | FileCheck %s2; CHECK-NOT: {{inttoptr|ptrtoint}}3; CHECK: scevgep4; CHECK-NOT: {{inttoptr|ptrtoint}}5target datalayout = "E-p:64:64:64-a0:0:8-f32:32:32-f64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-v64:64:64-v128:128:128-n32:64"6 7; Indvars shouldn't need inttoptr/ptrtoint to expand an address here.8 9define void @foo(ptr %p) nounwind {10entry:11 br i1 true, label %bb.nph, label %for.end12 13for.cond:14 %phitmp = icmp slt i64 %inc, 2015 br i1 %phitmp, label %for.body, label %for.cond.for.end_crit_edge16 17for.cond.for.end_crit_edge:18 br label %for.end19 20bb.nph:21 br label %for.body22 23for.body:24 %storemerge1 = phi i64 [ %inc, %for.cond ], [ 0, %bb.nph ]25 %call = tail call i64 @bar() nounwind26 %call2 = tail call i64 @car() nounwind27 %conv = trunc i64 %call2 to i828 %conv3 = sext i8 %conv to i6429 %add = add nsw i64 %call, %storemerge130 %add4 = add nsw i64 %add, %conv331 %arrayidx = getelementptr inbounds i8, ptr %p, i64 %add432 store i8 0, ptr %arrayidx33 %inc = add nsw i64 %storemerge1, 134 br label %for.cond35 36for.end:37 ret void38}39 40declare i64 @bar()41 42declare i64 @car()43