aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2025-01-27 22:45:37 -0800
committerGitHub <noreply@github.com>2025-01-27 22:45:37 -0800
commitb968fd95026639a2a1d2057627b41622f3b5c97d (patch)
tree2a7ffde6dd1c11a36a936e0bd179581afaa910e0 /llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp
parentea9993a9a3500c3fdda3faa731c458389458eaa6 (diff)
downloadllvm-b968fd95026639a2a1d2057627b41622f3b5c97d.zip
llvm-b968fd95026639a2a1d2057627b41622f3b5c97d.tar.gz
llvm-b968fd95026639a2a1d2057627b41622f3b5c97d.tar.bz2
[StrTable] Mechanically convert NVPTX builtins to use TableGen (#122873)
This switches them to use tho common TableGen layer, extending it to support the missing features needed by the NVPTX backend. The biggest thing was to build a TableGen system that computes the cumulative SM and PTX feature sets the same way the macros did. That's done with some string concatenation tricks in TableGen, but they worked out pretty neatly and are very comparable in complexity to the macro version. Then the actual defines were mapped over using a very hacky Python script. It was never productionized or intended to work in the future, but for posterity: https://gist.github.com/chandlerc/10bdf8fb1312e252b4a501bace184b66 Last but not least, there was a very odd "bug" in one of the converted builtins' prototype in the TableGen model: it didn't handle uses of `Z` and `U` both as *qualifiers* of a single type, treating `Z` as its own `int32_t` type. So my hacky Python script converted `ZUi` into two types, an `int32_t` and an `unsigned int`. This produced a very wrong prototype. But the tests caught this nicely and I fixed it manually rather than trying to improve the Python script as it occurred in exactly one place I could find. This should provide direct benefits of allowing future refactorings to more directly leverage TableGen to express builtins more structurally rather than textually. It will also make my efforts to move builtins to string tables significantly more effective for the NVPTX backend where the X-macro approach resulted in *significantly* less efficient string tables than other targets due to the long repeated feature strings.
Diffstat (limited to 'llvm/lib/Target/RISCV/Disassembler/RISCVDisassembler.cpp')
0 files changed, 0 insertions, 0 deletions