This is an archive of the discontinued LLVM Phabricator instance.

Revert "[SLP]Fix PR51320: Try to vectorize single store operands."
AbandonedPublic

Authored by kstoimenov on Oct 7 2022, 10:26 AM.

Details

Summary

This reverts commit 65c7cecb13f8d2132a54103903501474083afe8f.

I used bisect to find the above mentioned patch, which causes clang to crash with the code below. Let's revert and fix forward.
Thanks!

Instruction does not dominate all uses!
  %shuffle = shufflevector <2 x double> %add.i.i.i.i.i.i.i.i.i.i.i.i.i.i, <2 x double> poison, <2 x i32> <i32 1, i32 0>
  %0 = shufflevector <2 x double> zeroinitializer, <2 x double> %shuffle, <2 x i32> <i32 2, i32 1>
LLVM ERROR: Broken module found, compilation aborted!
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-grtev4-linux-gnu"

define i32 @crash() {
label:
  %0 = extractelement <2 x double> zeroinitializer, i64 1
  %1 = extractelement <2 x double> zeroinitializer, i64 0
  %add.i.i.i.i.i.i.i.i.i.i.i.i.i.i = fadd <2 x double> zeroinitializer, zeroinitializer
  %sroa.0.8.vec.extract = extractelement <2 x double> %add.i.i.i.i.i.i.i.i.i.i.i.i.i.i, i64 1
  %2 = fmul double %sroa.0.8.vec.extract, %1
  %conj.sroa.3.8.vec.insert = insertelement <2 x double> zeroinitializer, double %sroa.0.8.vec.extract, i64 0
  %sroa.0.0.vec.extract = extractelement <2 x double> %add.i.i.i.i.i.i.i.i.i.i.i.i.i.i, i64 0
  %mul.i.i23.i.i.i.i.i.i.i.i.i.i.i.i.i = fmul double %sroa.0.0.vec.extract, %0
  %add.i.i.i.i.i.i.i.i.i.i.i.i.i = fadd double %2, %mul.i.i23.i.i.i.i.i.i.i.i.i.i.i.i.i
  %mul.i.i.i.i.i.i.i.i.i.i.i.i = fmul double %add.i.i.i.i.i.i.i.i.i.i.i.i.i, 0.000000e+00
  store double %mul.i.i.i.i.i.i.i.i.i.i.i.i, double* null, align 16
  ret i32 0
}

Diff Detail

Event Timeline

kstoimenov created this revision.Oct 7 2022, 10:26 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 7 2022, 10:26 AM
kstoimenov requested review of this revision.Oct 7 2022, 10:26 AM
kstoimenov edited the summary of this revision. (Show Details)Oct 7 2022, 10:30 AM
kstoimenov edited the summary of this revision. (Show Details)Oct 7 2022, 10:32 AM

What is the issue? More info is required. What are the the opt options?

kstoimenov edited the summary of this revision. (Show Details)Oct 7 2022, 10:33 AM

In what way does it crash the clang? What are the compiler options?

kstoimenov edited the summary of this revision. (Show Details)Oct 7 2022, 10:36 AM
kstoimenov edited the summary of this revision. (Show Details)
kstoimenov edited the summary of this revision. (Show Details)

Fixed test.

If you build opt from head and run it like this: bin/opt -passes=slp-vectorizer with the code in the description it crashes.

The patch itself is not a source of the crash, it just reveals it, the problem is not related to the patch itself. Will fix it ASAP.

Thank you! Please CC me on the fix.

kstoimenov abandoned this revision.Oct 18 2022, 10:57 AM