[PATCH] D125713: [WebAssembly][NFC] Convert StackBased instruction field to 'bit' from string

Alex Bradbury via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 17 03:00:29 PDT 2022


asb added a comment.

In D125713#3517844 <https://reviews.llvm.org/D125713#3517844>, @asb wrote:

> In D125713#3517006 <https://reviews.llvm.org/D125713#3517006>, @Paul-C-Anagnostopoulos wrote:
>
>> The 'true' and 'false' literals are available.
>>
>> https://llvm.org/docs/TableGen/ProgRef.html#simple-values
>
> @Paul-C-Anagnostopoulos indeed, but they're not usable in KeyCol/ValueCols without some further changes to TableGen `Element type mismatch for list: element type 'int' not convertible to 'string`

Having a quick look at the options:

- Make it so int/bits are coercible to string. It would be very handy in this case, but I'd worry about unintended consequences
- Add some shorthand for `!cast<string>(foo)` that makes it a bit more attractive to use in this case. e.g. `let KeyCol = [!tostr(false)]`
- Making the logic for comparing KeyCol/ValueCols fuzzier. i.e. compare the field vs "false" in addition to "0". Not sure if this would have unintended consequences either...

Anyway, for the time being I'll land this and live with "0" and "1". But if you have any thoughts on the above, let me know.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125713/new/

https://reviews.llvm.org/D125713



More information about the llvm-commits mailing list