[PATCH] D40074: [GISel] Canonicalize constants to RHS for commutative operations

Daniel Sanders via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 15 11:48:16 PST 2017


dsanders added a comment.

I see why ARM is different from AArch64. ARM only sees one pattern being emitted because TableGen has some code that prevents commutativity being considered when one of the children of a commutative operator is either the `imm` operator or a plain integer (see `OnlyOnRHSOfCommutative()` which is used in `canPatternMatch()`).  Meanwhile, AArch64's case is using a ComplexPattern so both cases get emitted.

So it appears that TableGen considers commutative pattern but chooses to ignore the second pattern because it knows theres some canonicalization taking place.


https://reviews.llvm.org/D40074





More information about the llvm-commits mailing list