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

Ana Pazos via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 5 15:48:53 PST 2018


apazos added a comment.

Thanks Daniel for pushing this patch.
I tested it internally with my test cases and it works fine.
I also built all targets and did a 'ninja check-all' and I did not detect any new failures.
So I think no target breaks if we remove this Hack flag. Did you confirm it?

Now with this issue fixed, I want to raise another related issue (with tied operands) in AsmWriterEmitter::EmitPrintAliasInstruction.

Note that code bails out if number of operands in the AsmString is higher than the number of operands in the ResultString:

  // Don't emit the alias if it has more operands than what it's aliasing.
     if (NumResultOps < CountNumOperands(CGA.AsmString, Variant))
       continue;

So if you have:
Asmstring: "op $rd, $rd, $rs2 ->number of operands is 3
ResultString "newop $rd, $rs2" where rd is tied with the other rs1 input operand, the number of operands is 2.

I think here we should either count number of different operands in the AsmString or add the number of tied operands to the ResultString total number.


https://reviews.llvm.org/D41728





More information about the llvm-commits mailing list