[PATCH] D41728: [TableGen][AsmMatcherEmitter] Remove boolean 'Hack' parameter

Sander de Smalen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 19 05:47:29 PST 2018


sdesmalen abandoned this revision.
sdesmalen added a comment.

I'm abandoning this change as I have a new patch that addresses this properly: https://reviews.llvm.org/D42293.

In short, I think the error for aliases can be removed if and only if the repeated operand actually maps to a 'tied' operand that is checked during assembling.
So, for the example that @fhahn gave:

  def : InstAlias<"mov $dst, $src, $src, $src", (ORRWrs GPR32:$dst, WZR, GPR32:$src, 0), 2>;

The second `$src` is not linked to a tied operand, so repeating `$src` should cause TableGen to give an error. To demonstrate this, I added another SVE patch that defines an alias with a repeated operand here: https://reviews.llvm.org/D42295.
Adding another reference to `$Zdn` in the InstAlias asm string would also cause an error by TableGen.

While investigating this, I found that the generic tied operands constraint checks as implemented in https://reviews.llvm.org/D41446 did not properly cover aliases, this new patch fixes that.
@apazos, note that these constraint checks are a generalization of 'checkEarlyTargetMatchPredicate' which only seems to be implemented by Mips, so I think that can be removed when https://reviews.llvm.org/D42293 is merged.


https://reviews.llvm.org/D41728





More information about the llvm-commits mailing list