Test Failure: Transforms/SROA/alignment.ll

Test source: git

Comments: LLVM bug: memcpy-> load/store; needs 'byte' type

Log:

Source: <stdin>
-- 1. ModuleToFunctionPassAdaptor
ERROR: Unsupported instruction:   store volatile i16 0, ptr %gep1, align 2
ERROR: Unsupported instruction:   store volatile double 0.000000e+00, ptr %a, align 1
ERROR: Unsupported instruction:   store volatile double 0.000000e+00, ptr %a, align 1
ERROR: Unsupported instruction:   store atomic volatile i32 %1, ptr %B release, align 4
-- 1. PassManager<Function> : Skipping NOP
-- 2. SROAPass

----------------------------------------
define void @test1(ptr %a, ptr %b) {
entry:
  %alloca = alloca i64 2, align 16
  %gep_a = gep ptr %a, 2 x i32 0, 1 x i64 0
  %gep_alloca = gep ptr %alloca, 2 x i32 0, 1 x i64 0
  %gep_b = gep ptr %b, 2 x i32 0, 1 x i64 0
  store i8 164, ptr %gep_alloca, align 16
  memcpy ptr %gep_alloca align 16, ptr %gep_a align 16, i32 2
  memcpy ptr %gep_b align 16, ptr %gep_alloca align 16, i32 2
  ret void
}
Transformation seems to be correct! (syntactically equal)

-- 3. SROAPass

----------------------------------------
define void @test1(ptr %a, ptr %b) {
entry:
  %alloca = alloca i64 2, align 16
  %gep_a = gep ptr %a, 2 x i32 0, 1 x i64 0
  %gep_alloca = gep ptr %alloca, 2 x i32 0, 1 x i64 0
  %gep_b = gep ptr %b, 2 x i32 0, 1 x i64 0
  store i8 164, ptr %gep_alloca, align 16
  memcpy ptr %gep_alloca align 16, ptr %gep_a align 16, i32 2
  memcpy ptr %gep_b align 16, ptr %gep_alloca align 16, i32 2
  ret void
}
=>
define void @test1(ptr %a, ptr %b) {
entry:
  %gep_a = gep ptr %a, 2 x i32 0, 1 x i64 0
  %gep_b = gep ptr %b, 2 x i32 0, 1 x i64 0
  %alloca.sroa.0.0.copyload = load i8, ptr %gep_a, align 16
  %alloca.sroa.3.0.gep_a.sroa_idx = gep inbounds ptr %gep_a, 1 x i64 1
  %alloca.sroa.3.0.copyload = load i8, ptr %alloca.sroa.3.0.gep_a.sroa_idx, align 1
  store i8 %alloca.sroa.0.0.copyload, ptr %gep_b, align 16
  %alloca.sroa.3.0.gep_b.sroa_idx = gep inbounds ptr %gep_b, 1 x i64 1
  store i8 %alloca.sroa.3.0.copyload, ptr %alloca.sroa.3.0.gep_b.sroa_idx, align 1
  ret void
}
Transformation doesn't verify! (unsound)
ERROR: Mismatch in memory

Example:
ptr %a = pointer(non-local, block_id=1, offset=6) / Address=#x010
ptr %b = pointer(non-local, block_id=1, offset=6) / Address=#x010

Source:
ptr %alloca = pointer(local, block_id=0, offset=0) / Address=#x100
ptr %gep_a = pointer(non-local, block_id=1, offset=6) / Address=#x010
ptr %gep_alloca = pointer(local, block_id=0, offset=0) / Address=#x100
ptr %gep_b = pointer(non-local, block_id=1, offset=6) / Address=#x010

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: #x000
Block 1 >	size: 11	align: 2	alloc type: 0	alive: true	address: #x00a
Contents:
7: null, byte offset=0
*: pointer(non-local, block_id=0, offset=1), byte offset=1

Block 2 >	size: 0	align: 4	alloc type: 0	alive: true	address: #x004
Contents:
7: poison
*: poison


LOCAL BLOCKS:
Block 4 >	size: 2	align: 16	alloc type: 1	alive: true	address: #x100

Target:
ptr %gep_a = pointer(non-local, block_id=1, offset=6) / Address=#x010
ptr %gep_b = pointer(non-local, block_id=1, offset=6) / Address=#x010
i8 %alloca.sroa.0.0.copyload = poison
ptr %alloca.sroa.3.0.gep_a.sroa_idx = pointer(non-local, block_id=1, offset=7) / Address=#x011
i8 %alloca.sroa.3.0.copyload = poison
ptr %alloca.sroa.3.0.gep_b.sroa_idx = pointer(non-local, block_id=1, offset=7) / Address=#x011

TARGET MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: #x000
Block 1 >	size: 11	align: 2	alloc type: 0	alive: true	address: #x00a
Contents:
7: null, byte offset=0
*: pointer(non-local, block_id=0, offset=1), byte offset=1

Block 2 >	size: 0	align: 4	alloc type: 0	alive: true	address: #x004
Contents:
7: poison
*: poison


Mismatch in pointer(non-local, block_id=1, offset=6)
Source value: pointer(non-local, block_id=0, offset=1), byte offset=1
Target value: poison

Pass: SROAPass
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=sroa<preserve-cfg>' '-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_O8OZSkxq_TFVw.bc"

------------------- SMT STATS -------------------
Num queries: 34
Num invalid: 0
Num skips:   0
Num trivial: 13 (27.7%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     23 (67.6%)
Num UNSAT:   11 (32.4%)
Alive2: Transform doesn't verify; aborting!

stderr:

Transforms/SROA/alignment.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/SROA/alignment.ll -passes='sroa<preserve-cfg>' -S | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SROA/alignment.ll --check-prefixes=CHECK,CHECK-PRESERVE-CFG
# executed command: /home/nlopes/alive2/build/opt-alive.sh '-passes=sroa<preserve-cfg>' -S
# .---command stderr------------
# `-----------------------------
# error: command failed with exit status: 1
# executed command: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SROA/alignment.ll --check-prefixes=CHECK,CHECK-PRESERVE-CFG
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/SROA/alignment.ll --check-prefixes=CHECK,CHECK-PRESERVE-CFG
# `-----------------------------
# error: command failed with exit status: 2

--

 

<-- Back