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

Test source: git

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

Log:

Source: <stdin>

----------------------------------------
define i32 @cmp2(* nocapture nowrite %x, * nocapture nowrite %y) {
%0:
  %call = memcmp * nocapture nowrite %x, * nocapture nowrite %y, i64 2
  ret i32 %call
}
=>
define i32 @cmp2(* nocapture nowrite %x, * nocapture nowrite %y) {
%0:
  %1 = bitcast * nocapture nowrite %x to *
  %2 = bitcast * nocapture nowrite %y to *
  %3 = load i16, * %1, align 1
  %4 = load i16, * %2, align 1
  %5 = bswap i16 %3
  %6 = bswap i16 %4
  %7 = zext i16 %5 to i32
  %8 = zext i16 %6 to i32
  %9 = sub i32 %7, %8
  ret i32 %9
}
Transformation doesn't verify!
ERROR: Target is more poisonous than source

Example:
* nocapture nowrite %x = pointer(non-local, block_id=1, offset=0, attrs=3)
* nocapture nowrite %y = pointer(non-local, block_id=2, offset=0, attrs=3)

Source:
i32 %call = #x00000000 (0)

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

Target:
* %1 = pointer(non-local, block_id=1, offset=0, attrs=3)
* %2 = pointer(non-local, block_id=2, offset=0, attrs=3)
i16 %3 = poison
i16 %4 = poison
i16 %5 = poison
i16 %6 = poison
i32 %7 = poison
i32 %8 = poison
i32 %9 = poison
Source value: #x00000000 (0)
Target value: poison


------------------- SMT STATS -------------------
Num queries: 6
Num invalid: 0
Num skips:   0
Num trivial: 7 (53.8%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     5 (83.3%)
Num UNSAT:   1 (16.7%)
Alive2: Transform doesn't verify; aborting!

stderr:

+ : 'RUN: at line 2'
+ /home/nuno/alive2/build/opt-alive.sh -S -expandmemcmp -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
+ /home/nuno/llvm/build/bin/FileCheck /home/nuno/llvm/llvm/test/Transforms/ExpandMemCmp/X86/memcmp.ll --check-prefix=X64 --check-prefix=X64_1LD

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nuno/llvm/build/bin/FileCheck /home/nuno/llvm/llvm/test/Transforms/ExpandMemCmp/X86/memcmp.ll --check-prefix=X64 --check-prefix=X64_1LD

 

<-- Back