[SLP][NFC] Assert that tree entry operands completed when scheduler looks for dependencies.
This change adds an assertion to prevent tricky bug related to recursive approach of building vectorization tree. For loop below takes number of operands directly from tree entry rather than from scalars. If the entry at this moment turns out incomplete (i.e. not all operands set) then not all the dependencies will be seen by the scheduler. This can lead to failed scheduling (and thus failed vectorization) for perfectly vectorizable tree. Here is code example which is likely to fire the assertion: for (i : VL0->getNumOperands()) { ... TE->setOperand(i, Operands); buildTree_rec(Operands, Depth + 1,...); } Correct way is two steps process: first set all operands to a tree entry and then recursively process each operand. Differential Revision: https://reviews.llvm.org/D75296
Loading
Please register or sign in to comment