[PATCH] D46336: [InstCombine] Apply binary operator simplifications to associative/commutative cases.

Hiroshi Yamauchi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 3 15:12:33 PDT 2018


yamauchi added a comment.

FWIW, a nice thing is that this patch doesn't need to recognize and combine some specific patterns (eg. bitchecks, FoldPHIArgOrIntoPHI (https://reviews.llvm.org/D44626) or and-or-lshr (https://reviews.llvm.org/D45986)) or use some reassociation/canonicalization rules/orders based on some specific patterns (eg. some binops that operate on the same value for bitchecks, a certain definition of “matching pair” like https://reviews.llvm.org/D45842 or the ranking in the reassociate pass) (and those orders might conflict among them).

Rather, it applies the same instcombine simplification logic to the (previously-unexplored, alternative) associative/commutative positions of a binary operator as that to the original position, one associative/commutative opportunity at a time at the existing points in SimplifyAssociativeOrCommutative() and doesn’t require walking an entire subtree of instructions to find patterns or limiting the scope down to an artificially fixed size due to a compile time concern.


Repository:
  rL LLVM

https://reviews.llvm.org/D46336





More information about the llvm-commits mailing list