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

Roman Tereshin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 30 08:57:07 PDT 2018


rtereshin added a comment.

> I would tend to think that when we create instruction with constant we can discipline ourselves for not putting them on the LHS.

I'm not sure about this bit. Say, it's a mid-GlobalISel combine we're talking about. It matches a number of vregs along the boundary of a pattern it's supposed to match, and then uses them to generate an equivalent sequence. All it matched is a bunch of vregs from different places, it may not know what's constant and what's not, so how would it decide in which order to put those vregs in the generated instructions w/o explicitly checking for constants?


Repository:
  rL LLVM

https://reviews.llvm.org/D51362





More information about the llvm-commits mailing list