[PATCH] D96345: [DAG] Fold shuffle(bop(shuffle(x,y),shuffle(z,w)),bop(shuffle(a,b),shuffle(c,d)))

Sterling Augustine via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 16 14:14:55 PST 2021


saugustine added a comment.

this is as small as llvm-reduce makes the ir:

./bin/llc --mtriple x86_64-grtev4-linux-gnu -O1 $1

; ModuleID = '/usr/local/google/home/saugustine/tmp/test.ll'
source_filename = "/usr/local/google/home/saugustine/tmp/test.c"
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 dso_local i32 @j() {
entry:

  %0 = load <2 x i64>, <2 x i64>* undef, align 16, !tbaa !0
  %psrldq = shufflevector <16 x i8> undef, <16 x i8> <i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison, i8 poison>, <16 x i32> <i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23>
  %1 = load <2 x i64>, <2 x i64>* undef, align 16, !tbaa !0
  %2 = bitcast <2 x i64> %0 to <8 x i16>
  %3 = bitcast <2 x i64> %1 to <8 x i16>
  %add.i = add <8 x i16> %3, %2
  %4 = bitcast <8 x i16> %add.i to <2 x i64>
  %5 = bitcast <16 x i8> %psrldq to <8 x i16>
  %6 = bitcast <2 x i64> %1 to <8 x i16>
  %7 = shufflevector <8 x i16> %6, <8 x i16> poison, <8 x i32> <i32 4, i32 5, i32 6, i32 7, i32 undef, i32 undef, i32 undef, i32 undef>
  %add.i24 = add <8 x i16> %7, %5
  %8 = bitcast <8 x i16> %add.i24 to <2 x i64>
  %shuffle = shufflevector <2 x i64> %4, <2 x i64> %8, <2 x i32> <i32 0, i32 2>
  %9 = bitcast <2 x i64> %shuffle to <8 x i16>
  %10 = call <8 x i16> @llvm.x86.sse2.psrli.w(<8 x i16> %9, i32 ptrtoint (i32 ()* @j to i32))
  store <8 x i16> %10, <8 x i16>* undef, align 16, !tbaa !0
  ret i32 undef

}

; Function Attrs: nounwind readnone
declare <8 x i16> @llvm.x86.sse2.psrli.w(<8 x i16>, i32) #0

attributes #0 = { nounwind readnone }

!0 = !{!1, !1, i64 0}
!1 = !{!"omnipotent char", !2, i64 0}
!2 = !{!"Simple C/C++ TBAA"}


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96345



More information about the llvm-commits mailing list