Test source: git
Comments: LLVM PR57679
Source: <stdin> -- 1. ModuleToFunctionPassAdaptor -- 1. PassManager<Function> : Skipping NOP -- 2. FunctionToLoopPassAdaptor ---------------------------------------- define void @test(ptr %f, i32 %n) { entry: %#0 = shl i32 %n, 1 %cmp1 = icmp eq i32 %#0, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 0, ptr %arrayidx, align 4 %#1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %#1 store i32 0, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %#0 br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 3. PassManager<Function> : Skipping NOP -- 4. LoopSimplifyPass ---------------------------------------- define void @test(ptr %f, i32 %n) { entry: %#0 = shl i32 %n, 1 %cmp1 = icmp eq i32 %#0, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 0, ptr %arrayidx, align 4 %#1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %#1 store i32 0, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %#0 br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 5. LoopSimplifyPass ---------------------------------------- define void @test(ptr %f, i32 %n) { entry: %#0 = shl i32 %n, 1 %cmp1 = icmp eq i32 %#0, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 0, ptr %arrayidx, align 4 %#1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %#1 store i32 0, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %#0 br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 6. LCSSAPass ---------------------------------------- define void @test(ptr %f, i32 %n) { entry: %#0 = shl i32 %n, 1 %cmp1 = icmp eq i32 %#0, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 0, ptr %arrayidx, align 4 %#1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %#1 store i32 0, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %#0 br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 7. LCSSAPass ---------------------------------------- define void @test(ptr %f, i32 %n) { entry: %#0 = shl i32 %n, 1 %cmp1 = icmp eq i32 %#0, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 0, ptr %arrayidx, align 4 %#1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %#1 store i32 0, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %#0 br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 8. PassManager<Function> : Skipping NOP -- 9. PassManager<Loop, AnalysisManager<Loop, LoopStandardAnalysisResults&>, LoopStandardAnalysisResults&, LPMUpdater&> : Skipping NOP -- 10. LoopIdiomRecognizePass ---------------------------------------- define void @test(ptr %f, i32 %n) { entry: %#0 = shl i32 %n, 1 %cmp1 = icmp eq i32 %#0, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 0, ptr %arrayidx, align 4 %#1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %#1 store i32 0, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %#0 br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 11. LoopIdiomRecognizePass ---------------------------------------- define void @test(ptr %f, i32 %n) { entry: %#0 = shl i32 %n, 1 %cmp1 = icmp eq i32 %#0, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 0, ptr %arrayidx, align 4 %#1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %#1 store i32 0, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %#0 br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } => define void @test(ptr %f, i32 %n) { entry: %#0 = shl i32 %n, 1 %cmp1 = icmp eq i32 %#0, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: %#1 = add i32 %#0, 4294967295 %#2 = lshr i32 %#1, 1 %#3 = shl i32 %#2, 3 %#4 = add i32 %#3, 8 memset ptr %f align 4, i8 0, i32 %#4 br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %#0 br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! -- 12. PassManager<Loop, AnalysisManager<Loop, LoopStandardAnalysisResults&>, LoopStandardAnalysisResults&, LPMUpdater&> : Skipping NOP -- 13. FunctionToLoopPassAdaptor ---------------------------------------- define void @test(ptr %f, i32 %n) { entry: %#0 = shl i32 %n, 1 %cmp1 = icmp eq i32 %#0, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: %#1 = add i32 %#0, 4294967295 %#2 = lshr i32 %#1, 1 %#3 = shl i32 %#2, 3 %#4 = add i32 %#3, 8 memset ptr %f align 4, i8 0, i32 %#4 br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv %#5 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %#5 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %#0 br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 14. PassManager<Function> : Skipping NOP -- 15. PassManager<Function> : Skipping NOP -- 16. FunctionToLoopPassAdaptor ---------------------------------------- define void @test_pattern(ptr %f, i32 %n) { entry: %mul = shl i32 %n, 1 %cmp1 = icmp eq i32 %mul, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 2, ptr %arrayidx, align 4 %x1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %x1 store i32 2, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %mul br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 17. PassManager<Function> : Skipping NOP -- 18. LoopSimplifyPass ---------------------------------------- define void @test_pattern(ptr %f, i32 %n) { entry: %mul = shl i32 %n, 1 %cmp1 = icmp eq i32 %mul, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 2, ptr %arrayidx, align 4 %x1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %x1 store i32 2, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %mul br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 19. LoopSimplifyPass ---------------------------------------- define void @test_pattern(ptr %f, i32 %n) { entry: %mul = shl i32 %n, 1 %cmp1 = icmp eq i32 %mul, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 2, ptr %arrayidx, align 4 %x1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %x1 store i32 2, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %mul br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 20. LCSSAPass ---------------------------------------- define void @test_pattern(ptr %f, i32 %n) { entry: %mul = shl i32 %n, 1 %cmp1 = icmp eq i32 %mul, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 2, ptr %arrayidx, align 4 %x1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %x1 store i32 2, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %mul br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 21. LCSSAPass ---------------------------------------- define void @test_pattern(ptr %f, i32 %n) { entry: %mul = shl i32 %n, 1 %cmp1 = icmp eq i32 %mul, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 2, ptr %arrayidx, align 4 %x1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %x1 store i32 2, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %mul br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 22. PassManager<Function> : Skipping NOP -- 23. PassManager<Loop, AnalysisManager<Loop, LoopStandardAnalysisResults&>, LoopStandardAnalysisResults&, LPMUpdater&> : Skipping NOP -- 24. LoopIdiomRecognizePass ---------------------------------------- define void @test_pattern(ptr %f, i32 %n) { entry: %mul = shl i32 %n, 1 %cmp1 = icmp eq i32 %mul, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 2, ptr %arrayidx, align 4 %x1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %x1 store i32 2, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %mul br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation seems to be correct! (syntactically equal) -- 25. LoopIdiomRecognizePass ---------------------------------------- define void @test_pattern(ptr %f, i32 %n) { entry: %mul = shl i32 %n, 1 %cmp1 = icmp eq i32 %mul, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %arrayidx = gep inbounds ptr %f, 4 x i32 %indvars.iv store i32 2, ptr %arrayidx, align 4 %x1 = or disjoint i32 %indvars.iv, 1 %arrayidx2 = gep inbounds ptr %f, 4 x i32 %x1 store i32 2, ptr %arrayidx2, align 4 %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %mul br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } => declare void @memset_pattern16(ptr, ptr, i32) @.memset_pattern = constant 16 bytes, align 16 define void @test_pattern(ptr %f, i32 %n) { init: br label %entry entry: %mul = shl i32 %n, 1 %cmp1 = icmp eq i32 %mul, 0 br i1 %cmp1, label %for.end, label %for.body.preheader for.body.preheader: %#0 = add i32 %mul, 4294967295 %#1 = lshr i32 %#0, 1 %#2 = shl i32 %#1, 3 %#3 = add i32 %#2, 8 call void @memset_pattern16(ptr %f, ptr @.memset_pattern, i32 %#3) br label %for.body for.body: %indvars.iv = phi i32 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ] %indvars.iv.next = add nsw nuw i32 %indvars.iv, 2 %cmp = icmp ult i32 %indvars.iv.next, %mul br i1 %cmp, label %for.body, label %for.end.loopexit for.end.loopexit: br label %for.end for.end: ret void } Transformation doesn't verify! (unsound) ERROR: Source is more defined than target Example: ptr %f = pointer(non-local, block_id=1, offset=0) / Address=#x00000004 i32 %n = #x00000001 (1) Source: i32 %mul = #x00000002 (2) i1 %cmp1 = #x0 (0) >> Jump to %for.body.preheader >> Jump to %for.body i32 %indvars.iv = #x00000000 (0) ptr %arrayidx = pointer(non-local, block_id=1, offset=0) / Address=#x00000004 i32 %x1 = #x00000001 (1) ptr %arrayidx2 = pointer(non-local, block_id=1, offset=4) / Address=#x00000008 i32 %indvars.iv.next = #x00000002 (2) i1 %cmp = #x0 (0) >> Jump to %for.end.loopexit >> Jump to %for.end SOURCE MEMORY STATE =================== NON-LOCAL BLOCKS: Block 0 > size: 0 align: 4 alloc type: 0 alive: false address: 0 Block 1 > size: 8 align: 1 alloc type: 0 alive: true address: 4 Block 2 > size: 1 align: 1 alloc type: 0 alive: true address: 12 Block 3 > size: 16 align: 4 alloc type: 0 alive: true address: 128 const Target: UB triggered on br Pass: LoopIdiomRecognizePass 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' '-passes=loop-idiom' '-S' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats' Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_5HF8hv37_SZQE.bc" ------------------- SMT STATS ------------------- Num queries: 42 Num invalid: 0 Num skips: 0 Num trivial: 14 (25.0%) Num timeout: 0 (0.0%) Num errors: 0 (0.0%) Num SAT: 27 (64.3%) Num UNSAT: 15 (35.7%) Alive2: Transform doesn't verify; aborting!
RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh -passes=loop-idiom < /bitbucket/nlopes/llvm/llvm/test/Transforms/LoopIdiom/unroll-custom-dl.ll -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/LoopIdiom/unroll-custom-dl.ll + /home/nlopes/alive2/build/opt-alive.sh -passes=loop-idiom -S + /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/LoopIdiom/unroll-custom-dl.ll FileCheck error: '<stdin>' is empty. FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/LoopIdiom/unroll-custom-dl.ll