Test Failure: Transforms/SROA/select-load.ll

Test source: git

Comments: LLVM PR45152

Log:

Source: <stdin>

----------------------------------------
define <2 x i16> @test_load_bitcast_select(i1 %cond1, i1 %cond2) {
%entry:
  %true = alloca i64 2, align 2
  %false = alloca i64 2, align 2
  store half 65535, ptr %true, align 2
  store half 0, ptr %false, align 2
  %false.cast = bitcast ptr %false to ptr
  %true.cast = bitcast ptr %true to ptr
  %sel1 = select i1 %cond1, ptr %true.cast, ptr %false.cast
  %cast1 = bitcast ptr %sel1 to ptr
  %ld1 = load i16, ptr %cast1, align 2
  %v1 = insertelement <2 x i16> undef, i16 %ld1, i32 0
  %sel2 = select i1 %cond2, ptr %true.cast, ptr %false.cast
  %cast2 = bitcast ptr %sel2 to ptr
  %ld2 = load i16, ptr %cast2, align 2
  %v2 = insertelement <2 x i16> %v1, i16 %ld2, i32 1
  ret <2 x i16> %v2
}
=>
define <2 x i16> @test_load_bitcast_select(i1 %cond1, i1 %cond2) {
%entry:
  %0 = bitcast half 65535 to i16
  %1 = bitcast half 0 to i16
  %ld1.sroa.speculated = select i1 %cond1, i16 %0, i16 %1
  %v1 = insertelement <2 x i16> undef, i16 %ld1.sroa.speculated, i32 0
  %2 = bitcast half 65535 to i16
  %3 = bitcast half 0 to i16
  %ld2.sroa.speculated = select i1 %cond2, i16 %2, i16 %3
  %v2 = insertelement <2 x i16> %v1, i16 %ld2.sroa.speculated, i32 1
  ret <2 x i16> %v2
}
Transformation doesn't verify!
ERROR: Value mismatch

Example:
i1 %cond1 = #x1 (1)
i1 %cond2 = #x1 (1)

Source:
ptr %true = pointer(local, block_id=0, offset=0)
ptr %false = pointer(local, block_id=1, offset=0)
ptr %false.cast = pointer(local, block_id=1, offset=0)
ptr %true.cast = pointer(local, block_id=0, offset=0)
ptr %sel1 = pointer(local, block_id=0, offset=0)
ptr %cast1 = pointer(local, block_id=0, offset=0)
i16 %ld1 = #x7c00 (31744)
<2 x i16> %v1 = < #x7c00 (31744), #x0000 (0) >
ptr %sel2 = pointer(local, block_id=0, offset=0)
ptr %cast2 = pointer(local, block_id=0, offset=0)
i16 %ld2 = #x7c00 (31744)
<2 x i16> %v2 = < #x7c00 (31744), #x7c00 (31744) >

SOURCE MEMORY STATE
===================
LOCAL BLOCKS:
Block 0 >	size: 2	align: 2	alloc type: 1
Block 1 >	size: 2	align: 2	alloc type: 1

Target:
i16 %0 = #x7c20 (31776)
i16 %1 = #x0000 (0)
i16 %ld1.sroa.speculated = #x7c20 (31776)
<2 x i16> %v1 = < #x7c20 (31776), #x0000 (0) >
i16 %2 = #x7c02 (31746)
i16 %3 = #x0000 (0)
i16 %ld2.sroa.speculated = #x7c02 (31746)
<2 x i16> %v2 = < #x7c20 (31776), #x7c02 (31746) >
Source value: < #x7c00 (31744), #x7c00 (31744) >
Target value: < #x7c20 (31776), #x7c02 (31746) >


------------------- SMT STATS -------------------
Num queries: 7
Num invalid: 0
Num skips:   0
Num trivial: 32 (82.1%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     5 (71.4%)
Num UNSAT:   2 (28.6%)
Alive2: Transform doesn't verify; aborting!

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/SROA/select-load.ll
+ /home/nlopes/alive2/build/opt-alive.sh -S -passes=sroa

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/SROA/select-load.ll

 

<-- Back