Test Failure: Transforms/SLPVectorizer/X86/vectorize-reorder-alt-shuffle.ll

Test source: git

Log:

Source: <stdin>

----------------------------------------
define void @foo(* %c, * %d) {
%entry:
  %arrayidx1 = gep inbounds * %c, 1 x i64 4
  %0 = load i8, * %arrayidx1, align 1
  %conv2 = zext i8 %0 to i32
  %and = and i32 %conv2, 3
  %arrayidx4 = gep inbounds * %c, 1 x i64 1
  %1 = load i8, * %arrayidx4, align 1
  %conv5 = zext i8 %1 to i32
  %shl6 = shl nsw nuw i32 %conv5, 2
  %arrayidx12 = gep inbounds * %c, 1 x i64 2
  %2 = load i8, * %arrayidx12, align 1
  %conv13 = zext i8 %2 to i32
  %shl14 = shl nsw nuw i32 %conv13, 2
  %arrayidx17 = gep inbounds * %c, 1 x i64 3
  %3 = load i8, * %arrayidx17, align 1
  %conv18 = zext i8 %3 to i32
  %shl19 = shl nsw nuw i32 %conv18, 2
  %sub = add nsw i32 undef, %shl6
  %conv27 = sitofp i32 %sub to float
  %div = fdiv float %conv27, undef
  %add.ptr = gep inbounds * %d, 4 x i64 -1
  store float %div, * %add.ptr, align 4
  %sub32 = add nsw i32 undef, %and
  %conv33 = sitofp i32 %sub32 to float
  %div36 = fdiv float %conv33, undef
  %add.ptr37 = gep inbounds * %d, 4 x i64 -2
  store float %div36, * %add.ptr37, align 4
  %sub40 = add nsw i32 undef, %shl19
  %conv41 = sitofp i32 %sub40 to float
  %div44 = fdiv float %conv41, undef
  %add.ptr45 = gep inbounds * %d, 4 x i64 -3
  store float %div44, * %add.ptr45, align 4
  %sub48 = add nsw i32 undef, %shl14
  %conv49 = sitofp i32 %sub48 to float
  %div52 = fdiv float %conv49, undef
  %add.ptr53 = gep inbounds * %d, 4 x i64 -4
  store float %div52, * %add.ptr53, align 4
  ret void
}
=>
define void @foo(* %c, * %d) {
%entry:
  %arrayidx4 = gep inbounds * %c, 1 x i64 1
  %0 = bitcast * %arrayidx4 to *
  %1 = load <4 x i8>, * %0, align 1
  %2 = zext <4 x i8> %1 to <4 x i32>
  %3 = shl nsw nuw <4 x i32> %2, { 2, 2, 2, 3 }
  %4 = and <4 x i32> %2, { 2, 2, 2, 3 }
  %5 = shufflevector <4 x i32> %3, <4 x i32> %4, 1, 2, 7, 0
  %6 = add nsw <4 x i32> poison, %5
  %7 = sitofp <4 x i32> %6 to <4 x float>
  %8 = fdiv <4 x float> %7, poison
  %add.ptr53 = gep inbounds * %d, 4 x i64 -4
  %9 = bitcast * %add.ptr53 to *
  store <4 x float> %8, * %9, align 4
  ret void
}
Transformation doesn't verify!
ERROR: Mismatch in memory

Example:
* %c = pointer(non-local, block_id=1, offset=0)
* %d = pointer(non-local, block_id=2, offset=32)

Source:
* %arrayidx1 = pointer(non-local, block_id=1, offset=4)
i8 %0 = poison
i32 %conv2 = poison
i32 %and = poison
* %arrayidx4 = pointer(non-local, block_id=1, offset=1)
i8 %1 = poison
i32 %conv5 = poison
i32 %shl6 = poison
* %arrayidx12 = pointer(non-local, block_id=1, offset=2)
i8 %2 = #x00 (0)
i32 %conv13 = #x00000000 (0)
i32 %shl14 = #x00000000 (0)
* %arrayidx17 = pointer(non-local, block_id=1, offset=3)
i8 %3 = poison
i32 %conv18 = poison
i32 %shl19 = poison
i32 %sub = poison
float %conv27 = poison
float %div = poison
* %add.ptr = pointer(non-local, block_id=2, offset=28)
i32 %sub32 = poison
float %conv33 = poison
float %div36 = poison
* %add.ptr37 = pointer(non-local, block_id=2, offset=24)
i32 %sub40 = poison
float %conv41 = poison
float %div44 = poison
* %add.ptr45 = pointer(non-local, block_id=2, offset=20)
i32 %sub48 = any
float %conv49 = #x00000000 (+0.0)	[based on undef value]
float %div52 = NaN	[based on undef value]
* %add.ptr53 = pointer(non-local, block_id=2, offset=16)

SOURCE MEMORY STATE
===================
NON-LOCAL BLOCKS:
Block 0 >	size: 0	align: 1	alloc type: 0
Block 1 >	size: 9	align: 1	alloc type: 0
Block 2 >	size: 65	align: 16	alloc type: 0

Target:
* %arrayidx4 = pointer(non-local, block_id=1, offset=1)
* %0 = pointer(non-local, block_id=1, offset=1)
<4 x i8> %1 = < poison, #x00 (0), poison, poison >
<4 x i32> %2 = < poison, #x00000000 (0), poison, poison >
<4 x i32> %3 = < poison, #x00000000 (0), poison, poison >
<4 x i32> %4 = < poison, #x00000000 (0), poison, poison >
<4 x i32> %5 = < #x00000000 (0), poison, poison, poison >
<4 x i32> %6 = < poison, poison, poison, poison >
<4 x float> %7 = < poison, poison, poison, poison >
<4 x float> %8 = < poison, poison, poison, poison >
* %add.ptr53 = pointer(non-local, block_id=2, offset=16)
* %9 = pointer(non-local, block_id=2, offset=16)

Mismatch in pointer(non-local, block_id=2, offset=16)
Source value: #x00
Target value: poison


------------------- SMT STATS -------------------
Num queries: 8
Num invalid: 0
Num skips:   0
Num trivial: 29 (78.4%)
Num timeout: 0 (0.0%)
Num errors:  0 (0.0%)
Num SAT:     6 (75.0%)
Num UNSAT:   2 (25.0%)
Alive2: Transform doesn't verify; aborting!

stderr:

+ : 'RUN: at line 2'
+ /home/nlopes/alive2/build/opt-alive.sh -slp-vectorizer -S -mtriple=x86_64-unknown-linux-gnu
+ /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/SLPVectorizer/X86/vectorize-reorder-alt-shuffle.ll

FileCheck error: '<stdin>' is empty.
FileCheck command line:  /home/nlopes/llvm/build/bin/FileCheck /home/nlopes/llvm/llvm/test/Transforms/SLPVectorizer/X86/vectorize-reorder-alt-shuffle.ll

 

NOTE: This test would pass if undef didn't exist!

 

<-- Back