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 = call i32 @bcmp(nocapture ptr nocapture nowrite %x, nocapture 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: Source is more defined than target

Example:
ptr nocapture nowrite %x = poison
ptr nocapture nowrite %y = poison

Source:
i32 %call = function did not return!

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0	alive: false	address: 0
Block 1 >	size: 1	align: 1	alloc type: 0	alive: true	address: 2
Block 2 >	size: 3	align: 128	alloc type: 0	alive: true	address: 128
Block 3 >	size: 1	align: 128	alloc type: 0	alive: true	address: 128

Target:
i64 %#1 = UB triggered!


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: 27
Num invalid: 0
Num skips:   0
Num trivial: 0 (0.0%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     23 (85.2%)
Num UNSAT:   4 (14.8%)
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