Test source: git
Comments: Bug in IR semantics or optimization: escapes noescape pointer
Source: <stdin> -- 1. ModuleToFunctionPassAdaptor ERROR: Unsupported attribute: noalias -- 1. PassManager<Function> : Skipping NOP -- 2. LoopVectorizePass ---------------------------------------- define i32 @foo(ptr nocapture %a, ptr nocapture %b, i32 %n) { %entry: %cmp6 = icmp sgt i32 %n, 0 br i1 %cmp6, label %for.body, label %for.end %for.body: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = gep inbounds ptr nocapture %b, 4 x i64 %indvars.iv %0 = load float, ptr %arrayidx, align 4 %mul = fmul float %0, 3.000000, exceptions=ignore %arrayidx2 = gep inbounds ptr nocapture %a, 4 x i64 %indvars.iv store float %mul, ptr %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond = icmp eq i32 %lftr.wideiv, %n br i1 %exitcond, label %for.end, label %for.body %for.end: ret i32 undef } Transformation seems to be correct! (syntactically equal) -- 3. LoopVectorizePass ---------------------------------------- define i32 @foo(ptr nocapture %a, ptr nocapture %b, i32 %n) { %entry: %cmp6 = icmp sgt i32 %n, 0 br i1 %cmp6, label %for.body, label %for.end %for.body: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %entry ] %arrayidx = gep inbounds ptr nocapture %b, 4 x i64 %indvars.iv %0 = load float, ptr %arrayidx, align 4 %mul = fmul float %0, 3.000000, exceptions=ignore %arrayidx2 = gep inbounds ptr nocapture %a, 4 x i64 %indvars.iv store float %mul, ptr %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond = icmp eq i32 %lftr.wideiv, %n br i1 %exitcond, label %for.end, label %for.body %for.end: ret i32 undef } => define i32 @foo(ptr nocapture %a, ptr nocapture %b, i32 %n) { %entry: %b2 = ptrtoint ptr nocapture %b to i64 %a1 = ptrtoint ptr nocapture %a to i64 %cmp6 = icmp sgt i32 %n, 0 br i1 %cmp6, label %for.body.preheader, label %for.end %for.body.preheader: %0 = add i32 %n, 4294967295 %1 = zext i32 %0 to i64 %2 = add nsw nuw i64 %1, 1 %min.iters.check = icmp ult i64 %2, 4 br i1 %min.iters.check, label %scalar.ph, label %vector.memcheck %vector.memcheck: %3 = sub i64 %a1, %b2 %diff.check = icmp ult i64 %3, 16 br i1 %diff.check, label %scalar.ph, label %vector.ph %vector.ph: %n.mod.vf = urem i64 %2, 4 %n.vec = sub i64 %2, %n.mod.vf br label %vector.body %vector.body: %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ] %4 = add i64 %index, 0 %5 = gep inbounds ptr nocapture %b, 4 x i64 %4 %6 = gep inbounds ptr %5, 4 x i32 0 %7 = bitcast ptr %6 to ptr %wide.load = load <4 x float>, ptr %7, align 4 %8 = fmul <4 x float> %wide.load, { 3.000000, 3.000000, 3.000000, 3.000000 }, exceptions=ignore %9 = gep inbounds ptr nocapture %a, 4 x i64 %4 %10 = gep inbounds ptr %9, 4 x i32 0 %11 = bitcast ptr %10 to ptr store <4 x float> %8, ptr %11, align 4 %index.next = add nuw i64 %index, 4 %12 = icmp eq i64 %index.next, %n.vec br i1 %12, label %middle.block, label %vector.body %middle.block: %cmp.n = icmp eq i64 %2, %n.vec br i1 %cmp.n, label %for.end.loopexit, label %scalar.ph %scalar.ph: %bc.resume.val = phi i64 [ %n.vec, %middle.block ], [ 0, %for.body.preheader ], [ 0, %vector.memcheck ] br label %for.body %for.body: %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ %bc.resume.val, %scalar.ph ] %arrayidx = gep inbounds ptr nocapture %b, 4 x i64 %indvars.iv %13 = load float, ptr %arrayidx, align 4 %mul = fmul float %13, 3.000000, exceptions=ignore %arrayidx2 = gep inbounds ptr nocapture %a, 4 x i64 %indvars.iv store float %mul, ptr %arrayidx2, align 4 %indvars.iv.next = add i64 %indvars.iv, 1 %lftr.wideiv = trunc i64 %indvars.iv.next to i32 %exitcond = icmp eq i32 %lftr.wideiv, %n br i1 %exitcond, label %for.end.loopexit, label %for.body %for.end.loopexit: br label %for.end %for.end: ret i32 undef } Transformation doesn't verify! (unsound) ERROR: Source is more defined than target Example: ptr nocapture %a = poison ptr nocapture %b = poison i32 %n = #x80000004 (2147483652, -2147483644) Source: i1 %cmp6 = #x0 (0) >> Jump to %for.end SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 4 alloc type: 0 address: 0 Block 1 > size: 1325516685390394441 align: 8589934592 alloc type: 0 address: 9857077814180729874 Block 2 > size: 1283600712156450305 align: 16 alloc type: 0 address: 13418686264881451588 Target: i64 %b2 = UB triggered! Pass: LoopVectorizePass Command line: '/home/nlopes/llvm/build/bin/opt' '-load=/home/nlopes/alive2/build/tv/tv.so' '-load-pass-plugin=/home/nlopes/alive2/build/tv/tv.so' '-tv-exit-on-error' '-aa-pipeline=basic-aa' '-passes=loop-vectorize,dce,instcombine' '-force-vector-interleave=1' '-force-vector-width=4' '-S' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats' ------------------- SMT STATS ------------------- Num queries: 6 Num invalid: 0 Num skips: 0 Num trivial: 2 (25.0%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 6 (100.0%) Num UNSAT: 0 (0.0%) Alive2: Transform doesn't verify; aborting!
+ : 'RUN: at line 2' + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/LoopVectorize/runtime-check.ll + /home/nlopes/alive2/build/opt-alive.sh -aa-pipeline=basic-aa -passes=loop-vectorize,dce,instcombine -force-vector-interleave=1 -force-vector-width=4 -S FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/LoopVectorize/runtime-check.ll