1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

[SelectionDAGBuilder] Restrict vector reduction check to types with a power of 2 number of elements.

The check for the shuffles usages probably isn't correct for non power of 2 vectors.

llvm-svn: 337651
This commit is contained in:
Craig Topper 2018-07-22 05:16:49 +00:00
parent 95dfaf3248
commit 4415c5307b

View File

@ -2668,6 +2668,10 @@ static bool isVectorReductionOp(const User *I) {
}
unsigned ElemNum = Inst->getType()->getVectorNumElements();
// Ensure the reduction size is a power of 2.
if (!isPowerOf2_32(ElemNum))
return false;
unsigned ElemNumToReduce = ElemNum;
// Do DFS search on the def-use chain from the given instruction. We only