Revert "[DAG] Fold shuffle(bop(shuffle(x,y),shuffle(z,w)),bop(shuffle(a,b),shuffle...
authorSterling Augustine <saugustine@google.com>
Tue, 16 Feb 2021 20:37:19 +0000 (12:37 -0800)
committerSterling Augustine <saugustine@google.com>
Tue, 16 Feb 2021 20:48:15 +0000 (12:48 -0800)
commit5aa8f4c0843a68a24cb37dce5c0248c849d7d476
treea1e8080484ce0b97dda3f828b8d7b600a9f52b9c
parent8eda10ca09c25f631d41f040137c89145bdcbc1a
Revert "[DAG] Fold shuffle(bop(shuffle(x,y),shuffle(z,w)),bop(shuffle(a,b),shuffle(c,d)))"

This reverts commit 5dfba562dd247f731528448ee83785b099f93629.

That commit causes an assertion failure with the following repro:

typedef long b __attribute__((__vector_size__(16)));
b *d;
b e;
b __attribute__((__always_inline__)) c(b h, b i) {
  return (__attribute__((__vector_size__(8 * sizeof(short)))) short)h + i;
}
j() {
  b k, l, m, n, o[6], p, q;
  m = d[5];
  b r = m;
  b s = f(r, 8);
  q = s;
  l = d[1];
  p = l;
  t(q);
  n = c(m, l);
  o[1] = c(s, f(p, 8));
  k = __builtin_shufflevector(n, o[1], 0, 2);
  e = __builtin_ia32_psrlwi128(k, j);
}

./bin/clang -cc1 -triple x86_64-grtev4-linux-gnu -emit-obj -O1 -std=c99 test.c
llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
llvm/lib/Target/X86/X86ISelLowering.cpp
llvm/test/CodeGen/X86/bitcast-and-setcc-256.ll
llvm/test/CodeGen/X86/promote-cmp.ll