[X86] SimplifyMultipleUseDemandedBits - target shuffles might not be identity

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.

llvm-svn: 368022
This commit is contained in:
Simon Pilgrim 2019-08-06 12:41:29 +00:00
parent 3cfeaa4d2c
commit 01d267dc4f
1 changed files with 3 additions and 2 deletions

View File

@ -34758,12 +34758,13 @@ SDValue X86TargetLowering::SimplifyMultipleUseDemandedBitsForTargetNode(
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]);