[PATCH] D51362: [GlobalISel][IRTranslator] Canonicalize G_ICMP to have constant operands last

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 31 12:00:12 PDT 2018


aemerson added a comment.

In https://reviews.llvm.org/D51362#1221028, @qcolombet wrote:

> > It can't do that all the time, with these G_ICMPs for example it also has to swap the predicate (not that we even have imported patterns that could possibly match for AArch64).
>
> Why not?
>  I understand G_ICMPs are special, but we could come up with whatever complicated logic in TableGen.


Some forms of an instruction, like certain I_CMP predicates, may not be legal and the target might want to transform them into a sequence of compares for example.

If we agree that an input canonicalization pass is needed then doing this there adds much less complexity than teaching tablegen that G_ICMPs are special (or somehow adding legalisation rules to tablegen?).


Repository:
  rL LLVM

https://reviews.llvm.org/D51362





More information about the llvm-commits mailing list