Test Failure: Transforms/ExpandMemCmp/X86/bcmp.ll

Test source: git

Comments: LLVM bug: load widening of i8 -> i64

Log:

Source: <stdin>

----------------------------------------
declare i32 @bcmp(nocapture ptr, nocapture ptr, i64)

define i32 @bcmp8(ptr nocapture nowrite %x, ptr nocapture nowrite %y) {
#0:
  %call = bcmp ptr nocapture nowrite %x, ptr nocapture nowrite %y, i64 8
  ret i32 %call
}
=>
define i32 @bcmp8(ptr nocapture nowrite %x, ptr nocapture nowrite %y) {
#0:
  %#1 = load i64, ptr nocapture nowrite %x, align 1
  %#2 = load i64, ptr nocapture nowrite %y, align 1
  %#3 = icmp ne i64 %#1, %#2
  %#4 = zext i1 %#3 to i32
  ret i32 %#4
}
Transformation doesn't verify! (unsound)
ERROR: Target is more poisonous than source

Example:
ptr nocapture nowrite %x = pointer(non-local, block_id=1, offset=6, attrs=3) / Address=#x15
ptr nocapture nowrite %y = pointer(non-local, block_id=2, offset=6, attrs=3) / Address=#x07

Source:
i32 %call = #x00000008 (8)

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: 0
Block 1 >	size: 15	align: 1	alloc type: 0	alive: true	address: 15
Contents:
6: #x00
7: #x20
11: poison
9: null, byte offset=0
10: #x00
8: #x00
13: #x20
12: poison
*: #x06

Block 2 >	size: 14	align: 1	alloc type: 0	alive: true	address: 1
Contents:
6: #xce
7: poison
*: #x06


Target:
i64 %#1 = poison
i64 %#2 = poison
i1 %#3 = poison
i32 %#4 = poison
Source value: #x00000008 (8)
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' '-memcmp-num-loads-per-block=1' '-mtriple=x86_64-unknown-unknown' '-data-layout=e-m:o-i64:64-f80:128-n8:16:32:64-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: 5 (14.3%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     17 (56.7%)
Num UNSAT:   13 (43.3%)
Alive2: Transform doesn't verify; aborting!

stderr:

RUN: at line 2: /home/nlopes/alive2/build/opt-alive.sh -S -expand-memcmp -memcmp-num-loads-per-block=1 -mtriple=x86_64-unknown-unknown -data-layout=e-m:o-i64:64-f80:128-n8:16:32:64-S128         < /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandMemCmp/X86/bcmp.ll | /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandMemCmp/X86/bcmp.ll --check-prefix=X64
+ /home/nlopes/alive2/build/opt-alive.sh -S -expand-memcmp -memcmp-num-loads-per-block=1 -mtriple=x86_64-unknown-unknown -data-layout=e-m:o-i64:64-f80:128-n8:16:32:64-S128
+ /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandMemCmp/X86/bcmp.ll --check-prefix=X64

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /bitbucket/nlopes/llvm/build/bin/FileCheck /bitbucket/nlopes/llvm/llvm/test/Transforms/ExpandMemCmp/X86/bcmp.ll --check-prefix=X64

 

<-- Back