[PATCH] D100884: Generalize getInvertibleOperand to support mismatched phi operand order

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 20 14:30:16 PDT 2021


nikic added a comment.

I don't think this is particularly valuable in terms of optimization power, but I do think the interface makes a bit more sense that way. Though I would suggest to go one step further and return `std::pair<Value *, Value *>`. That is, for a pair of input values, it returns a pair of output values that preserve the equality relationship. This should make the phi case particularly nice, because you can simply return `{Start1, Start2}` rather than checking for different possibilities of operand orders.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100884



More information about the llvm-commits mailing list