[MachineCombiner] Lift same-bb restriction for reassociable ops.
This patch relaxes the restriction that both reassociate operands must be in the same block as the root instruction. The comment indicates that the reason for this restriction was that the operands not in the same block won't have a depth in the trace. I believe this is outdated; if the operand is in a different block, it must dominate the current block (otherwise it would need to be phi), which in turn means the operand's block must be included in the current rance, and depths must be available. There's a test case (no_reassociate_different_block) added in 70520e2f which shows that we have accurate depths for operands defined in other blocks. This allows reassociation of code that computes the final reduction value after vectorization, among other things. Reviewed By: dmgreen Differential Revision: https://reviews.llvm.org/D141302
Loading
Please sign in to comment