Skip to content

slp-vectorizer miscompiles when creating shufflevector and vectorizing many ops #113425

Closed
@bongjunj

Description

@bongjunj

Alive2 report: https://alive2.llvm.org/ce/z/y-pAyx

----------------------------------------
define <2 x i8> @g.2(<2 x i8> %x, <2 x i8> %y) {
#0:
  %x0 = extractelement <2 x i8> %x, i32 0
  %y1 = extractelement <2 x i8> %y, i32 1
  %x0x0 = mul i8 %x0, undef
  %y1y1 = mul nsw i8 %y1, %y1
  %ins1 = insertelement <2 x i8> undef, i8 %x0x0, i32 0
  %ins2 = insertelement <2 x i8> %ins1, i8 %y1y1, i32 1
  ret <2 x i8> %ins2
}
=>
define <2 x i8> @g.2(<2 x i8> %x, <2 x i8> %y) {
#0:
  %#1 = shufflevector <2 x i8> %x, <2 x i8> %y, 0, 3
  %#2 = mul <2 x i8> %#1, %y
  ret <2 x i8> %#2
}
Transformation doesn't verify!

ERROR: Target is more poisonous than source

Example:
<2 x i8> %x = < #x00 (0)	[based on undef value], poison >
<2 x i8> %y = < poison, poison >

Source:
i8 %x0 = #x00 (0)
i8 %y1 = poison
i8 %x0x0 = #x00 (0)
i8 %y1y1 = poison
<2 x i8> %ins1 = < #x00 (0), #x00 (0) >
<2 x i8> %ins2 = < #x00 (0), poison >

Target:
<2 x i8> %#1 = < #x00 (0), poison >
<2 x i8> %#2 = < poison, poison >
Source value: < #x00 (0), poison >
Target value: < poison, poison >

Summary:
  0 correct transformations
  1 incorrect transformations
  0 failed-to-prove transformations
  0 Alive2 errors

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions