[PATCH] D115750: [SLP]Further improvement of the cost model for scalars used in buildvectors.

Arthur Eubanks via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 13 09:30:55 PDT 2022


aeubanks added a comment.

Another crash caused by this:

  $ cat /tmp/f.ll
  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-unknown-linux-android23"
  
  %0 = type { float, float, float, float }
  
  ; Function Attrs: argmemonly nocallback nofree nosync nounwind willreturn
  declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0
  
  ; Function Attrs: argmemonly nocallback nofree nosync nounwind willreturn
  declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0
  
  ; Function Attrs: argmemonly nofree nounwind willreturn writeonly
  declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1
  
  define internal void @0() {
    %1 = getelementptr inbounds %0, ptr undef, i64 0, i32 2
    %2 = load float, ptr %1, align 4
    %3 = load float, ptr undef, align 4
    %4 = fsub float %2, %3
    %5 = getelementptr inbounds %0, ptr undef, i64 0, i32 3
    %6 = load float, ptr %5, align 4
    %7 = getelementptr inbounds %0, ptr undef, i64 0, i32 1
    %8 = load float, ptr %7, align 4
    %9 = fsub float %6, %8
    %10 = fcmp olt float %9, %4
    %11 = insertelement <2 x float> undef, float %3, i64 0
    %12 = insertelement <2 x float> zeroinitializer, float 0.000000e+00, i64 0
    store <2 x float> zeroinitializer, ptr null, align 4
    %13 = insertelement <2 x float> %11, float %6, i64 0
    store <2 x float> zeroinitializer, ptr null, align 4
    ret void
  }
  
  attributes #0 = { argmemonly nocallback nofree nosync nounwind willreturn }
  attributes #1 = { argmemonly nofree nounwind willreturn writeonly }
  $ bin/opt -passes=slp-vectorizer -disable-output /tmp/f.ll
  opt: ../../llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:6657: T *performExtractsShuffleAction(MutableArrayRef<std::pair<T *, SmallVector<int>>>, llvm::Value *, function_ref<unsigned int (T *)>
  , function_ref<std::pair<T *, bool> (T *, ArrayRef<int>)>, function_ref<T *(ArrayRef<int>, ArrayRef<T *>)>) [T = const llvm::slpvectorizer::BoUpSLP::TreeEntry]: Assertion `Mask[I] == UndefMaskEle
  m && "Multiple uses of scalars."' failed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D115750/new/

https://reviews.llvm.org/D115750



More information about the llvm-commits mailing list