[PATCH] D119754: [InstCombine] reassociate min/max intrinsics with constant operands

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 14 13:03:14 PST 2022


spatel added a comment.

In D119754#3320296 <https://reviews.llvm.org/D119754#3320296>, @lebedev.ri wrote:

> For this to work in practice, we also need: https://alive2.llvm.org/ce/z/XC3JqP

You mean to enable more general reassociation to cascade?

If the reassociate pass handled intrinsics, it would go the other direction (pull the constant higher up in the instruction sequence). I suspect it wouldn't be a small patch to generalize that pass to handle intrinsics instead of just true binop instructions.

I didn't think instcombine inverted that, but it does do that for 'or' instructions at least:
https://github.com/llvm/llvm-project/blob/cccef321096c20825fe8738045c1d91d3b9fd57d/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp#L2938


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119754/new/

https://reviews.llvm.org/D119754



More information about the llvm-commits mailing list