Test source: git
Comments: LLVM bug: load widening of i8 -> i16
Source: <stdin>
----------------------------------------
declare i32 @memcmp(nocapture ptr, nocapture ptr, i32)
define i32 @cmp2(ptr nocapture nowrite %x, ptr nocapture nowrite %y) {
#0:
%call = tail memcmp ptr nocapture nowrite %x, ptr nocapture nowrite %y, i32 2
ret i32 %call
}
=>
define i32 @cmp2(ptr nocapture nowrite %x, ptr nocapture nowrite %y) {
#0:
%#1 = load i16, ptr nocapture nowrite %x, align 1
%#2 = load i16, ptr nocapture nowrite %y, align 1
%#3 = bswap i16 %#1
%#4 = bswap i16 %#2
%#5 = zext i16 %#3 to i32
%#6 = zext i16 %#4 to i32
%#7 = sub i32 %#5, %#6
ret i32 %#7
}
Transformation doesn't verify! (unsound)
ERROR: Target is more poisonous than source
Example:
ptr nocapture nowrite %x = pointer(non-local, block_id=1, offset=0, attrs=3) / Address=#x00000005
ptr nocapture nowrite %y = pointer(non-local, block_id=1, offset=1, attrs=3) / Address=#x00000006
Source:
i32 %call = #x80000003 (2147483651, -2147483645)
SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: #x00000000
Block 1 > size: 9 align: 1 alloc type: 4 alive: true address: #x00000005
Contents:
1: #xf6
2: poison
*: #x09
Block 2 > size: 0 align: 1 alloc type: 0 alive: true address: #x00000004
Target:
i16 %#1 = #xf609 (62985, -2551)
i16 %#2 = poison
i16 %#3 = #x09f6 (2550)
i16 %#4 = poison
i32 %#5 = #x000009f6 (2550)
i32 %#6 = poison
i32 %#7 = poison
TARGET MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 > size: 0 align: 1 alloc type: 0 alive: false address: #x00000000
Block 1 > size: 9 align: 1 alloc type: 4 alive: true address: #x00000005
Contents:
1: #xf6
2: poison
*: #x09
Block 2 > size: 0 align: 1 alloc type: 0 alive: true address: #x00000004
Source value: #x80000003 (2147483651, -2147483645)
Target value: poison
Pass:
Command line: '/home/nlopes/llvm/build/bin/opt' '-load=/home/nlopes/alive2/build/tv/tv.so' '-tv-exit-on-error' '-tv' '-S' '-expand-memcmp' '-mtriple=i686-unknown-unknown' '-data-layout=e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128' '-tv' '-tv-smt-to=20000' '-tv-report-dir=/home/nlopes/alive2/build/logs' '-tv-smt-stats'
------------------- SMT STATS -------------------
Num queries: 30
Num invalid: 0
Num skips: 0
Num trivial: 9 (23.1%)
Num timeout: 0 (0.0%)
Num errors: 0 (0.0%)
Num SAT: 19 (63.3%)
Num UNSAT: 11 (36.7%)
Alive2: Transform doesn't verify; aborting!
Transforms/ExpandMemCmp/X86/memcmp-x32.ll' FAILED ******************** Exit Code: 2 Command Output (stdout): -- # RUN: at line 2 /home/nlopes/alive2/build/opt-alive.sh -S -expand-memcmp -mtriple=i686-unknown-unknown -data-layout=e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128 < /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandMemCmp/X86/memcmp-x32.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandMemCmp/X86/memcmp-x32.ll --check-prefix=X32 # executed command: /home/nlopes/alive2/build/opt-alive.sh -S -expand-memcmp -mtriple=i686-unknown-unknown -data-layout=e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128 # .---command stderr------------ # `----------------------------- # error: command failed with exit status: 1 # executed command: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandMemCmp/X86/memcmp-x32.ll --check-prefix=X32 # .---command stderr------------ # | FileCheck error: '<stdin>' is empty. # | FileCheck command line: /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandMemCmp/X86/memcmp-x32.ll --check-prefix=X32 # `----------------------------- # error: command failed with exit status: 2 --