Test Failure: Transforms/LoopIdiom/unroll.ll

Test source: git

Log:

Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
-- 1. PassManager<Function> : Skipping NOP
-- 2. FunctionToLoopPassAdaptor

----------------------------------------
define void @test(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:
  %#0 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 0, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 0, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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:
  %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 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 0, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 0, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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:
  %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 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 0, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 0, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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:
  %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 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 0, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 0, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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:
  %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 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 0, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 0, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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:
  %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 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 0, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 0, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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:
  %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 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 0, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 0, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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:
  %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 = zext i32 %mul to i64
  %#1 = add nsw i64 %#0, -1
  %#2 = lshr i64 %#1, 1
  %#3 = shl i64 %#2, 3
  %#4 = add i64 %#3, 8
  memset ptr %f align 4, i8 0, i64 %#4
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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:
  %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 = zext i32 %mul to i64
  %#1 = add nsw i64 %#0, -1
  %#2 = lshr i64 %#1, 1
  %#3 = shl i64 %#2, 3
  %#4 = add i64 %#3, 8
  memset ptr %f align 4, i8 0, i64 %#4
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  %#5 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#5
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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:
  %#0 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 2, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 2, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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)

-- 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:
  %#0 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 2, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 2, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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)

-- 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:
  %#0 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 2, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 2, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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)

-- 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:
  %#0 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 2, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 2, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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)

-- 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:
  %#0 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 2, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 2, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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)

-- 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:
  %#0 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 2, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 2, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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)

-- 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:
  %#0 = zext i32 %mul to i64
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %arrayidx = gep inbounds ptr %f, 4 x i64 %indvars.iv
  store i32 2, ptr %arrayidx, align 4
  %#1 = or disjoint i64 %indvars.iv, 1
  %arrayidx2 = gep inbounds ptr %f, 4 x i64 %#1
  store i32 2, ptr %arrayidx2, align 4
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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
}
=>
declare void @memset_pattern16(nocapture noread ptr, nocapture nowrite ptr, i64) nofree willreturn memory(argmem: readwrite)

@.memset_pattern = constant 16 bytes, align 16

define void @test_pattern(ptr %f, i32 %n) {
init:
  store [4 x i32] { 2, 2, 2, 2 }, ptr @.memset_pattern, align 16
  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 = zext i32 %mul to i64
  %#1 = add nsw i64 %#0, -1
  %#2 = lshr i64 %#1, 1
  %#3 = shl i64 %#2, 3
  %#4 = add i64 %#3, 8
  memset_pattern16 ptr %f, ptr @.memset_pattern, i64 %#4
  br label %for.body

for.body:
  %indvars.iv = phi i64 [ 0, %for.body.preheader ], [ %indvars.iv.next, %for.body ]
  %indvars.iv.next = add nsw nuw i64 %indvars.iv, 2
  %cmp = icmp ult i64 %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 doesn't verify! (unsound)
ERROR: Mismatch in memory

Example:
ptr %f = pointer(non-local, block_id=1, offset=1) / Address=#x0000000000000004
i32 %n = #x00000001 (1)

Source:
i32 %mul = #x00000002 (2)
i1 %cmp1 = #x0 (0)
  >> Jump to %for.body.preheader
i64 %#0 = #x0000000000000002 (2)
  >> Jump to %for.body
i64 %indvars.iv = #x0000000000000000 (0)
ptr %arrayidx = pointer(non-local, block_id=1, offset=1) / Address=#x0000000000000004
i64 %#1 = #x0000000000000001 (1)
ptr %arrayidx2 = pointer(non-local, block_id=1, offset=5) / Address=#x0000000000000008
i64 %indvars.iv.next = #x0000000000000002 (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: 1	alloc type: 0	alive: false	address: 0
Block 1 >	size: 14	align: 1	alloc type: 0	alive: true	address: 3
Block 2 >	size: 16	align: 1	alloc type: 0	alive: true	address: 64	const

Target:
  >> Jump to %entry
i32 %mul = #x00000002 (2)
i1 %cmp1 = #x0 (0)
  >> Jump to %for.body.preheader
i64 %#0 = #x0000000000000002 (2)
i64 %#1 = #x0000000000000001 (1)
i64 %#2 = #x0000000000000000 (0)
i64 %#3 = #x0000000000000000 (0)
i64 %#4 = #x0000000000000008 (8)
  >> Jump to %for.body
i64 %indvars.iv = #x0000000000000000 (0)
i64 %indvars.iv.next = #x0000000000000002 (2)
i1 %cmp = #x0 (0)
  >> Jump to %for.end.loopexit
  >> Jump to %for.end

Mismatch in pointer(non-local, block_id=1, offset=5)
Source value: #x02
Target value: #x00

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_t3IItyWy_ux4O.bc"


------------------- SMT STATS -------------------
Num queries: 43
Num invalid: 0
Num skips:   0
Num trivial: 29 (40.3%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     27 (62.8%)
Num UNSAT:   16 (37.2%)
Alive2: Transform doesn't verify; aborting!

stderr:

RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh -passes=loop-idiom < /bitbucket/nlopes/llvm/llvm/test/Transforms/LoopIdiom/unroll.ll -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/LoopIdiom/unroll.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.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/LoopIdiom/unroll.ll

 

<-- Back