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=0, attrs=3) / Address=#x08
ptr nocapture nowrite dereferenceable(16) %b = pointer(non-local, block_id=1, offset=36, attrs=3) / Address=#x2c

Source:
i32 %#0 = #x01010101 (16843009)
i32 %#1 = #x00000000 (0)
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: #x00
Block 1 >	size: 137	align: 8	alloc type: 2	alive: false	address: #x08
Contents:
36: #x00
38: #x00
40: null, byte offset=0
3: #x01
42: #x80
9: #x01
2: #x01
39: #x00
45: null, byte offset=0
4: #x02
6: null, byte offset=0
11: #x00
43: #x02
7: #x01
47: #x00
0: #x01
37: #x00
8: poison
41: null, byte offset=0
1: #x01
5: #x01
44: null, byte offset=0
*: poison

Block 2 >	size: 0	align: 1	alloc type: 0	alive: true	address: #x02
Contents:
36: #x01
38: #x01
40: #x00
43: #x00
42: #x00
47: #x01
37: #x01
41: #x00
39: #x01
46: #x10
45: #x00
44: #x00
*: poison

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

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

TARGET MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: #x00
Block 1 >	size: 137	align: 8	alloc type: 2	alive: false	address: #x08
Contents:
36: #x00
38: #x00
40: null, byte offset=0
3: #x01
42: #x80
9: #x01
2: #x01
39: #x00
45: null, byte offset=0
4: #x02
6: null, byte offset=0
11: #x00
43: #x02
7: #x01
47: #x00
0: #x01
37: #x00
8: poison
41: null, byte offset=0
1: #x01
5: #x01
44: null, byte offset=0
*: poison

Block 2 >	size: 0	align: 1	alloc type: 0	alive: true	address: #x02
Contents:
36: #x01
38: #x01
40: #x00
43: #x00
42: #x00
47: #x01
37: #x01
41: #x00
39: #x01
46: #x10
45: #x00
44: #x00
*: poison

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


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

------------------- SMT STATS -------------------
Num queries: 84
Num invalid: 0
Num skips:   0
Num trivial: 6 (6.7%)
Num timeout: 0 (0.0%)
Num errors:  1 (1.2%)
Num SAT:     65 (77.4%)
Num UNSAT:   18 (21.4%)
Alive2: Transform doesn't verify; aborting!

stderr:

Transforms/MergeICmps/X86/split-block-does-work.ll' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 2
/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
# executed command: /home/nlopes/alive2/build/opt-alive.sh -passes=mergeicmps -verify-dom-info -mtriple=x86_64-unknown-unknown -S
# .---command stderr------------
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/MergeICmps/X86/split-block-does-work.ll --check-prefix=X86
# .---command stderr------------
# | 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
# `-----------------------------
# error: command failed with exit status: 2

--

 

<-- Back