Skip to content

slp-vectorizer miscompile #142347

Open
Open
@mikaelholmen

Description

@mikaelholmen

llvm commit: 9801fdf
Reproduce with: opt -passes="slp-vectorizer" bbi-107513.ll -S -o -
Result:

define i16 @foo() {
entry:
  %cond3 = select i1 false, i16 1, i16 0
  ret i16 %cond3
}

The function should return the value 1, but with slp-vectorizer we get 0 instead.

This starts happening with d41e517

[SLP] Make getSameOpcode support interchangeable instructions. (#135797)

We use the term "interchangeable instructions" to refer to different
operators that have the same meaning (e.g., `add x, 0` is equivalent to
`mul x, 1`).
Non-constant values are not supported, as they may incur high costs with
little benefit.

---------

Co-authored-by: Alexey Bataev <a.bataev@gmx.com>

bbi-107513.ll.gz

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions