If we don't demand any non-undef shuffle elements then the assert will fail as all shuffle inputs would still be flagged as 'identity' safe.
Exposed by an incoming patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368022
91177308-0d34-0410-b5e6-
96231b3b80d8
if (IdentityOp == 0)
break;
}
- assert((IdentityOp == 0 || IdentityOp.countPopulation() == 1) &&
- "Multiple identity shuffles detected");
if (AllUndef)
return DAG.getUNDEF(VT);
+ assert((IdentityOp == 0 || IdentityOp.countPopulation() == 1) &&
+ "Multiple identity shuffles detected");
+
for (int i = 0; i != NumOps; ++i)
if (IdentityOp[i])
return DAG.getBitcast(VT, ShuffleOps[i]);