[PATCH] D107966: [SLP]Do not emit extract elements for insertelements users, replace with shuffles directly.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat May 21 12:57:05 PDT 2022


fhahn added a comment.

It looks like this patch is causing SLPVectorizer to crash with the following IR. This blocks building SPEC on X86, so I'll go ahead and revert this for now to unblock testing.

  target datalayout = "e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
  target triple = "x86_64-apple-macosx"
  
  define i64 @foo(ptr %arg, i32 %arg1) unnamed_addr #0 {
  bb:
    %tmp = sub i32 undef, undef
    %tmp2 = sub nsw i32 undef, %tmp
    %tmp3 = add i32 undef, %tmp2
    %tmp4 = xor i32 %tmp3, undef
    %tmp5 = add i32 undef, %tmp4
    %tmp6 = sub i32 undef, undef
    %tmp7 = load i32, ptr undef, align 4
    %tmp8 = sub i32 %tmp7, undef
    %tmp9 = sub nsw i32 0, undef
    %tmp10 = add nsw i32 %tmp8, %tmp6
    %tmp11 = sub nsw i32 %tmp6, %tmp8
    %tmp12 = add i32 undef, %tmp10
    %tmp13 = xor i32 %tmp12, undef
    %tmp14 = add i32 undef, %tmp9
    %tmp15 = xor i32 %tmp14, undef
    %tmp16 = add i32 undef, %tmp11
    %tmp17 = xor i32 %tmp16, undef
    %tmp18 = add i32 %tmp13, %tmp5
    %tmp19 = add i32 %tmp18, undef
    %tmp20 = add i32 %tmp19, %tmp15
    %tmp21 = add i32 %tmp20, %tmp17
    %tmp22 = sub i32 undef, undef
    %tmp23 = add i32 undef, undef
    %tmp24 = sub i32 undef, undef
    %tmp25 = add nsw i32 %tmp23, undef
    %tmp26 = add nsw i32 %tmp24, %tmp22
    %tmp27 = sub nsw i32 %tmp22, %tmp24
    %tmp28 = add i32 undef, %tmp25
    %tmp29 = xor i32 %tmp28, undef
    %tmp30 = add i32 undef, %tmp26
    %tmp31 = xor i32 %tmp30, undef
    %tmp32 = add i32 undef, %tmp27
    %tmp33 = xor i32 %tmp32, undef
    %tmp34 = add i32 %tmp31, %tmp21
    %tmp35 = add i32 %tmp34, %tmp29
    %tmp36 = add i32 %tmp35, undef
    %tmp37 = add i32 %tmp36, %tmp33
    %tmp38 = sub nsw i32 undef, undef
    %tmp39 = add i32 undef, %tmp38
    %tmp40 = xor i32 %tmp39, undef
    %tmp41 = add i32 undef, %tmp37
    %tmp42 = add i32 %tmp41, 0
    %tmp43 = add i32 %tmp42, %tmp40
    %tmp44 = add i32 %tmp43, undef
    %tmp45 = add i32 undef, %tmp44
    %tmp46 = add i32 %tmp45, undef
    %tmp47 = add i32 %tmp46, undef
    %tmp48 = add i32 %tmp47, 0
    %tmp49 = add i32 undef, %tmp48
    %tmp50 = add i32 %tmp49, undef
    %tmp51 = add i32 %tmp50, undef
    %tmp52 = add i32 %tmp51, 0
    %tmp53 = add i32 undef, %tmp52
    %tmp54 = add i32 %tmp53, undef
    %tmp55 = add i32 %tmp54, undef
    %tmp56 = add i32 %tmp55, 0
    %tmp57 = add i32 0, %tmp56
    %tmp58 = add i32 %tmp57, 0
    %tmp59 = add i32 %tmp58, 0
    %tmp60 = add i32 %tmp59, 0
    %tmp61 = lshr i32 %tmp60, 16
    %tmp62 = add nuw nsw i32 undef, %tmp61
    %tmp63 = sub nsw i32 %tmp62, undef
    %tmp64 = zext i32 %tmp63 to i64
    %tmp65 = shl nuw i64 %tmp64, 32
    %tmp66 = add i64 %tmp65, undef
    ret i64 %tmp66
  }
  
  attributes #0 = { "target-features"="+64bit,+adx,+aes,+avx,+avx2" }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D107966



More information about the llvm-commits mailing list