[PATCH] D146906: Generate `MachineValueType.h` (partially) from `ValueTypes.td`

Nemanja Ivanovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 18 08:05:58 PDT 2023


nemanjai added inline comments.


================
Comment at: llvm/utils/TableGen/VTEmitter.cpp:79
+
+    UpdateVTRange("VALUETYPE", Name, Value < 224);
+
----------------
I don't really follow the logic here. Between this code and the subsequent reorganization of MachineValueTypes.h to generate the MVT, what meaning does an enumerator such as `LAST_VALUETYPE` have?
Prior to this, there was a sequence of consecutive VT's and `LAST_VALUTYPE` was set to the last one. As people add more, if they exceed `MAX_ALLOWED_VALUETYPE`, the `static_assert` will let them know.

With this reorganization, if someone defines types number 224, 225, etc. there will be no compile issue and `LAST_VALUETYPE` will be set to whatever number 223 is - everything else will presumably be ignored by the legalizer or whatever else depends on this. Is this really the intended behaviour?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146906



More information about the llvm-commits mailing list