Test Failure: Transforms/MergeICmps/X86/split-block-does-work.ll

Test source: git

Log:

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

----------------------------------------
declare void @foo(...)

define i1 @opeq1(ptr nocapture nowrite dereferenceable(16) %a, ptr nocapture nowrite dereferenceable(16) %b) nofree zeroext {
entry:
  %#0 = load i32, ptr nocapture nowrite dereferenceable(16) %a, align 4
  %#1 = load i32, ptr nocapture nowrite dereferenceable(16) %b, align 4
  call void @foo() memory(inaccessiblemem: readwrite)
  %cmp.i = icmp eq i32 %#0, %#1
  br i1 %cmp.i, label %land.rhs.i, label %opeq1.exit

land.rhs.i:
  %second.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %a, 16 x i64 0, 1 x i64 4
  %#2 = load i32, ptr %second.i, align 4
  %second2.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %b, 16 x i64 0, 1 x i64 4
  %#3 = load i32, ptr %second2.i, align 4
  %cmp2.i = icmp eq i32 %#2, %#3
  br i1 %cmp2.i, label %land.rhs.i.2, label %opeq1.exit

land.rhs.i.2:
  %third.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %a, 16 x i64 0, 1 x i64 8
  %#4 = load i32, ptr %third.i, align 4
  %third2.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %b, 16 x i64 0, 1 x i64 8
  %#5 = load i32, ptr %third2.i, align 4
  %cmp3.i = icmp eq i32 %#4, %#5
  br i1 %cmp3.i, label %land.rhs.i.3, label %opeq1.exit

land.rhs.i.3:
  %fourth.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %a, 16 x i64 0, 1 x i64 12
  %#6 = load i32, ptr %fourth.i, align 4
  %fourth2.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %b, 16 x i64 0, 1 x i64 12
  %#7 = load i32, ptr %fourth2.i, align 4
  %cmp4.i = icmp eq i32 %#6, %#7
  br label %opeq1.exit

opeq1.exit:
  %#8 = phi i1 [ 0, %entry ], [ 0, %land.rhs.i ], [ 0, %land.rhs.i.2 ], [ %cmp4.i, %land.rhs.i.3 ]
  ret i1 %#8
}
Transformation seems to be correct! (syntactically equal)

-- 3. MergeICmpsPass

----------------------------------------
declare void @foo(...)

define i1 @opeq1(ptr nocapture nowrite dereferenceable(16) %a, ptr nocapture nowrite dereferenceable(16) %b) nofree zeroext {
entry:
  %#0 = load i32, ptr nocapture nowrite dereferenceable(16) %a, align 4
  %#1 = load i32, ptr nocapture nowrite dereferenceable(16) %b, align 4
  call void @foo() memory(inaccessiblemem: readwrite)
  %cmp.i = icmp eq i32 %#0, %#1
  br i1 %cmp.i, label %land.rhs.i, label %opeq1.exit

land.rhs.i:
  %second.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %a, 16 x i64 0, 1 x i64 4
  %#2 = load i32, ptr %second.i, align 4
  %second2.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %b, 16 x i64 0, 1 x i64 4
  %#3 = load i32, ptr %second2.i, align 4
  %cmp2.i = icmp eq i32 %#2, %#3
  br i1 %cmp2.i, label %land.rhs.i.2, label %opeq1.exit

land.rhs.i.2:
  %third.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %a, 16 x i64 0, 1 x i64 8
  %#4 = load i32, ptr %third.i, align 4
  %third2.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %b, 16 x i64 0, 1 x i64 8
  %#5 = load i32, ptr %third2.i, align 4
  %cmp3.i = icmp eq i32 %#4, %#5
  br i1 %cmp3.i, label %land.rhs.i.3, label %opeq1.exit

land.rhs.i.3:
  %fourth.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %a, 16 x i64 0, 1 x i64 12
  %#6 = load i32, ptr %fourth.i, align 4
  %fourth2.i = gep inbounds ptr nocapture nowrite dereferenceable(16) %b, 16 x i64 0, 1 x i64 12
  %#7 = load i32, ptr %fourth2.i, align 4
  %cmp4.i = icmp eq i32 %#6, %#7
  br label %opeq1.exit

opeq1.exit:
  %#8 = phi i1 [ 0, %entry ], [ 0, %land.rhs.i ], [ 0, %land.rhs.i.2 ], [ %cmp4.i, %land.rhs.i.3 ]
  ret i1 %#8
}
=>
declare void @foo(...)
declare i32 @memcmp(nocapture ptr, nocapture ptr, i64) nofree willreturn memory(argmem: read)

define i1 @opeq1(ptr nocapture nowrite dereferenceable(16) %a, ptr nocapture nowrite dereferenceable(16) %b) nofree zeroext {
entry+land.rhs.i+land.rhs.i.2+land.rhs.i.3:
  call void @foo() memory(inaccessiblemem: readwrite)
  %memcmp = memcmp ptr nocapture nowrite dereferenceable(16) %a, ptr nocapture nowrite dereferenceable(16) %b, i64 16
  %#0 = icmp eq i32 %memcmp, 0
  br label %opeq1.exit

opeq1.exit:
  ret i1 %#0
}
Transformation doesn't verify! (unsound)
ERROR: Source is more defined than target

Example:
ptr nocapture nowrite dereferenceable(16) %a = pointer(non-local, block_id=1, offset=4, attrs=3) / Address=#x0c
ptr nocapture nowrite dereferenceable(16) %b = pointer(non-local, block_id=1, offset=52, attrs=3) / Address=#x3c

Source:
i32 %#0 = #x01000001 (16777217)
i32 %#1 = #x00012000 (73728)
Function @foo returned
i1 %cmp.i = #x0 (0)
  >> Jump to %opeq1.exit
i1 %#8 = #x0 (0)

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: 0
Block 1 >	size: 128	align: 8	alloc type: 2	alive: false	address: 8
Contents:
56: #x01
10: poison
54: #x01
52: #x00
58: #x01
9: #x01
15: #x01
14: #x01
55: #x00
61: #x02
13: null, byte offset=0
4: #x01
6: #x00
7: #x01
11: null, byte offset=0
59: #x01
63: #x00
53: #x20
8: null, byte offset=0
12: #x04
57: null, byte offset=0
62: #x00
60: #x40
5: #x00
*: poison

Block 2 >	size: 0	align: 1	alloc type: 0	alive: true	address: 8
Contents:
56: #x00
54: #x00
59: #x00
52: #x01
58: #x00
63: #x01
53: #x00
55: #x01
57: #x00
62: #x01
61: #x00
60: #x00
*: poison

Block 3 >	size: 0	align: 1	alloc type: 0	alive: true	address: 1

Target:
Function @foo returned
i32 %memcmp = UB triggered!


Pass: MergeICmpsPass
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=mergeicmps' '-verify-dom-info' '-mtriple=x86_64-unknown-unknown' '-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_bsEEDweR_Tskp.bc"


------------------- SMT STATS -------------------
Num queries: 56
Num invalid: 0
Num skips:   0
Num trivial: 6 (9.7%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     42 (75.0%)
Num UNSAT:   14 (25.0%)
Alive2: Transform doesn't verify; aborting!

stderr:

/home/nlopes/alive2/build/opt-alive.sh < /bitbucket/nlopes/llvm/llvm/test/Transforms/MergeICmps/X86/split-block-does-work.ll -passes=mergeicmps -verify-dom-info -mtriple=x86_64-unknown-unknown -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/MergeICmps/X86/split-block-does-work.ll --check-prefix=X86 # RUN: at line 2
+ /home/nlopes/alive2/build/opt-alive.sh -passes=mergeicmps -verify-dom-info -mtriple=x86_64-unknown-unknown -S
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/MergeICmps/X86/split-block-does-work.ll --check-prefix=X86

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/MergeICmps/X86/split-block-does-work.ll --check-prefix=X86

 

<-- Back