Test Failure: Transforms/InstCombine/pr44835.ll

Test source: git

Comments: LLVM bug: memcpy -> i8 load/store

Log:

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

----------------------------------------
define void @test(ptr %p, ptr %p2) {
#0:
  %v = load i32, ptr %p, align 4
  %v2 = load i32, ptr %p2, align 4
  %cmp = icmp ult i32 %v2, %v
  %sel = select i1 %cmp, ptr %p2, ptr %p
  memcpy ptr %p align 4, ptr %sel align 4, i64 4
  ret void
}
Transformation seems to be correct! (syntactically equal)

-- 3. InstCombinePass

----------------------------------------
define void @test(ptr %p, ptr %p2) {
#0:
  %v = load i32, ptr %p, align 4
  %v2 = load i32, ptr %p2, align 4
  %cmp = icmp ult i32 %v2, %v
  %sel = select i1 %cmp, ptr %p2, ptr %p
  memcpy ptr %p align 4, ptr %sel align 4, i64 4
  ret void
}
=>
define void @test(ptr %p, ptr %p2) {
#0:
  %v = load i32, ptr %p, align 4
  %v2 = load i32, ptr %p2, align 4
  %#1 = umin i32 %v2, %v
  store i32 %#1, ptr %p, align 4
  ret void
}
Transformation doesn't verify! (unsound)
ERROR: Mismatch in memory

Example:
ptr %p = pointer(non-local, block_id=1, offset=0) / Address=#x0000000000000008
ptr %p2 = pointer(non-local, block_id=1, offset=0) / Address=#x0000000000000008

Source:
i32 %v = #x00c08400 (12616704)
i32 %v2 = #x00c08400 (12616704)
i1 %cmp = #x0 (0)
ptr %sel = pointer(non-local, block_id=1, offset=0) / Address=#x0000000000000008

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: #x0000000000000000
Block 1 >	size: 4	align: 8	alloc type: 4	alive: true	address: #x0000000000000008
Contents:
0: pointer(non-local, block_id=1, offset=1099511628024), byte offset=0
1: #x84
2: #xc0
3: pointer(non-local, block_id=0, offset=128), byte offset=1
*: poison

Block 2 >	size: 0	align: 2	alloc type: 0	alive: true	address: #x0000000000000002
Contents:
0: pointer(non-local, block_id=1, offset=1099511628024), byte offset=0
1: #x84
2: #xc0
3: pointer(non-local, block_id=0, offset=128), byte offset=1
*: poison


Target:
i32 %v = #x00c08400 (12616704)
i32 %v2 = #x00c08400 (12616704)
i32 %#1 = #x00c08400 (12616704)

TARGET MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: #x0000000000000000
Block 1 >	size: 4	align: 8	alloc type: 4	alive: true	address: #x0000000000000008
Contents:
0: pointer(non-local, block_id=1, offset=1099511628024), byte offset=0
1: #x84
2: #xc0
3: pointer(non-local, block_id=0, offset=128), byte offset=1
*: poison

Block 2 >	size: 0	align: 2	alloc type: 0	alive: true	address: #x0000000000000002
Contents:
0: pointer(non-local, block_id=1, offset=1099511628024), byte offset=0
1: #x84
2: #xc0
3: pointer(non-local, block_id=0, offset=128), byte offset=1
*: poison


Mismatch in pointer(non-local, block_id=1, offset=0)
Source value: pointer(non-local, block_id=1, offset=1099511628024), byte offset=0
Target value: #x00

Pass: InstCombinePass
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' '-S' '-passes=instcombine' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'

Wrote bitcode to: "/home/nlopes/alive2/build/logs/in_mGnIUO3K_E14d.bc"

------------------- SMT STATS -------------------
Num queries: 33
Num invalid: 0
Num skips:   0
Num trivial: 14 (29.8%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     22 (66.7%)
Num UNSAT:   11 (33.3%)
Alive2: Transform doesn't verify; aborting!

stderr:

Transforms/InstCombine/pr44835.ll' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 2
/home/nlopes/alive2/build/opt-alive.sh -S -passes=instcombine < /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/pr44835.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/pr44835.ll
# executed command: /home/nlopes/alive2/build/opt-alive.sh -S -passes=instcombine
# .---command stderr------------
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/pr44835.ll
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/InstCombine/pr44835.ll
# `-----------------------------
# error: command failed with exit status: 2

--

 

<-- Back