Skip to content

slp-vectorizer miscompile #161140

@mikaelholmen

Description

@mikaelholmen

llvm commit: ab5bba5
Reproduce with:

opt -passes=slp-vectorizer bbi-110973_2.ll -S -o - -slp-threshold=-100

which results in

define i1 @foo(i1 %v) {
entry:
  %0 = insertelement <2 x i1> poison, i1 %v, i32 0
  %1 = shufflevector <2 x i1> %0, <2 x i1> poison, <2 x i32> zeroinitializer
  %2 = mul <2 x i1> <i1 false, i1 true>, %1
  %3 = extractelement <2 x i1> %2, i32 0
  %4 = extractelement <2 x i1> %2, i32 1
  %sub = sub i1 %3, %4
  ret i1 %sub
}

If you e.g. calculate the result for input value %v == 1 you see that the results before/after slp-vectorizer are different.

See also
alive2

bbi-110973_2.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