<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/utils/TableGen/DisassemblerEmitter.cpp, branch users/nico/python-2</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[TableGen] [NFC] Refine TableGen code to comply with `clang-tidy` checks (#113318)</title>
<updated>2024-10-29T18:10:54+00:00</updated>
<author>
<name>Jerry Sun</name>
<email>105613447+jerryyiransun@users.noreply.github.com</email>
</author>
<published>2024-10-29T18:10:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cdacc9b5c7ec020bad24dbdcbeba96ac1d2713e5'/>
<id>cdacc9b5c7ec020bad24dbdcbeba96ac1d2713e5</id>
<content type='text'>
Code cleanups for TableGen files, changes includes function names,
variable names and unused imports.

---------

Co-authored-by: Matt Arsenault &lt;Matthew.Arsenault@amd.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Code cleanups for TableGen files, changes includes function names,
variable names and unused imports.

---------

Co-authored-by: Matt Arsenault &lt;Matthew.Arsenault@amd.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[LLVM][TableGen] Change DisassemblerEmitter to use const RecordKeeper (#109177)</title>
<updated>2024-09-20T11:22:37+00:00</updated>
<author>
<name>Rahul Joshi</name>
<email>rjoshi@nvidia.com</email>
</author>
<published>2024-09-20T11:22:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b594b93024bbe24bddbcc0e54cb5551e0df642cf'/>
<id>b594b93024bbe24bddbcc0e54cb5551e0df642cf</id>
<content type='text'>
Change DisassemblerEmitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Change DisassemblerEmitter to use const RecordKeeper.

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089</pre>
</div>
</content>
</entry>
<entry>
<title>[TableGen] Allow emitter callbacks to use `const RecordKeeper &amp;` (#104716)</title>
<updated>2024-08-26T19:10:33+00:00</updated>
<author>
<name>Rahul Joshi</name>
<email>rjoshi@nvidia.com</email>
</author>
<published>2024-08-26T19:10:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=34dee0a96105d6aeb8b386efbbbfe437ab1be02e'/>
<id>34dee0a96105d6aeb8b386efbbbfe437ab1be02e</id>
<content type='text'>
- Refactor TableGen backend options to allow specifying a callback
  function that takes either a const reference or a non-const reference
  to `RecordKeeper`. This will enable gradual migration of code to use
  const references and pointers to `RecordKeeper` and  `Record` in the
  TableGen backends. 

- Refactor handling of the callback command line options. Move variable
  for the command line option from the header to the CPP file, and add a
  function `ApplyCallback` to apply the selected callback.

- Change callbacks in TableGen.cpp to take const reference. They use the
  `Opt` class to register their callbacks.

- Change IntrinsicEmitter to use the `OptClass` to define its callbacks.
  It already uses a const reference in the implementation.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Refactor TableGen backend options to allow specifying a callback
  function that takes either a const reference or a non-const reference
  to `RecordKeeper`. This will enable gradual migration of code to use
  const references and pointers to `RecordKeeper` and  `Record` in the
  TableGen backends. 

- Refactor handling of the callback command line options. Move variable
  for the command line option from the header to the CPP file, and add a
  function `ApplyCallback` to apply the selected callback.

- Change callbacks in TableGen.cpp to take const reference. They use the
  `Opt` class to register their callbacks.

- Change IntrinsicEmitter to use the `OptClass` to define its callbacks.
  It already uses a const reference in the implementation.</pre>
</div>
</content>
</entry>
<entry>
<title>[RFC][TableGen] Restructure TableGen Source (#80847)</title>
<updated>2024-03-25T08:40:35+00:00</updated>
<author>
<name>Pierre van Houtryve</name>
<email>pierre.vanhoutryve@amd.com</email>
</author>
<published>2024-03-25T08:40:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fa3d789df15bd1f58fb8ba4ea3be909218cf7f03'/>
<id>fa3d789df15bd1f58fb8ba4ea3be909218cf7f03</id>
<content type='text'>
Refactor of the llvm-tblgen source into:
- a "Basic" library, which contains the bare minimum utilities to build
`llvm-min-tablegen`
- a "Common" library which contains all of the helpers for TableGen
backends. Such helpers can be shared by more than one backend, and even
unit tested (e.g. CodeExpander is, maybe we can add more over time)

Fixes #80647</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Refactor of the llvm-tblgen source into:
- a "Basic" library, which contains the bare minimum utilities to build
`llvm-min-tablegen`
- a "Common" library which contains all of the helpers for TableGen
backends. Such helpers can be shared by more than one backend, and even
unit tested (e.g. CodeExpander is, maybe we can add more over time)

Fixes #80647</pre>
</div>
</content>
</entry>
<entry>
<title>[TableGen] Suppress per-HwMode duplicate instructions/tables. (#82567)</title>
<updated>2024-02-22T03:36:10+00:00</updated>
<author>
<name>Jason Eckhardt</name>
<email>jeckhardt@nvidia.com</email>
</author>
<published>2024-02-22T03:36:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=05af9c83f3a0d154f73d619ac1361eae05531e5e'/>
<id>05af9c83f3a0d154f73d619ac1361eae05531e5e</id>
<content type='text'>
Currently, for per-HwMode encoding/decoding, those instructions that do
not have a HwMode override are duplicated into the decoder tables for
all HwModes. This includes inducing multiple tables for instructions
that are otherwise unrelated (e.g., different namespace with no
overrides at all).

This patch adds support to suppress instruction and table duplicates.
TableGen option "-gen-disassembler --suppress-per-hwmode-duplicates"
enables the suppression (off by default).

For one downstream backend with a complicated ISA and major
cross-generation encoding differences, this eliminates ~32000 duplicate
table entries at the time of this patch.

There are legitimate reasons to suppress or not suppress duplicates. If
there are relatively few non-overridden related instructions, it can be
convenient to pull them into the per-mode tables (only need to decode
the per-mode tables, slightly simpler decode function in disassembler).
On the other hand, in some backends, the opposite is true or the size is
too large to tolerate any duplication in the first place. We let the
user decide which makes sense.

This is currently off by default, though there is no reason it couldn't
be enabled by default. Any existing backends downstream using the
per-HwMode feature will function as before. Turning on the feature
requires minor modifications to their disassembler due to more/less
tables and naming.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, for per-HwMode encoding/decoding, those instructions that do
not have a HwMode override are duplicated into the decoder tables for
all HwModes. This includes inducing multiple tables for instructions
that are otherwise unrelated (e.g., different namespace with no
overrides at all).

This patch adds support to suppress instruction and table duplicates.
TableGen option "-gen-disassembler --suppress-per-hwmode-duplicates"
enables the suppression (off by default).

For one downstream backend with a complicated ISA and major
cross-generation encoding differences, this eliminates ~32000 duplicate
table entries at the time of this patch.

There are legitimate reasons to suppress or not suppress duplicates. If
there are relatively few non-overridden related instructions, it can be
convenient to pull them into the per-mode tables (only need to decode
the per-mode tables, slightly simpler decode function in disassembler).
On the other hand, in some backends, the opposite is true or the size is
too large to tolerate any duplication in the first place. We let the
user decide which makes sense.

This is currently off by default, though there is no reason it couldn't
be enabled by default. Any existing backends downstream using the
per-HwMode feature will function as before. Turning on the feature
requires minor modifications to their disassembler due to more/less
tables and naming.</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] clang-format utils/TableGen (#80973)</title>
<updated>2024-02-09T08:27:04+00:00</updated>
<author>
<name>Pierre van Houtryve</name>
<email>pierre.vanhoutryve@amd.com</email>
</author>
<published>2024-02-09T08:27:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b9079baaddfed5e604fbfaa1d81a7a1c38e78c26'/>
<id>b9079baaddfed5e604fbfaa1d81a7a1c38e78c26</id>
<content type='text'>
```
find llvm/utils/TableGen -iname "*.h" -o -iname "*.cpp" | xargs clang-format-16 -i
```

Split from #80847</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
```
find llvm/utils/TableGen -iname "*.h" -o -iname "*.cpp" | xargs clang-format-16 -i
```

Split from #80847</pre>
</div>
</content>
</entry>
<entry>
<title>llvm-tblgen: Rewrite emitters to use `TableGen::Emitter`</title>
<updated>2023-03-21T07:21:27+00:00</updated>
<author>
<name>NAKAMURA Takumi</name>
<email>geek4civic@gmail.com</email>
</author>
<published>2023-02-19T05:30:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9c93e728bfb8079c1de51e5481168c4083038c2a'/>
<id>9c93e728bfb8079c1de51e5481168c4083038c2a</id>
<content type='text'>
Each emitter became self-contained since it has the registration of option.

Differential Revision: https://reviews.llvm.org/D144351
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Each emitter became self-contained since it has the registration of option.

Differential Revision: https://reviews.llvm.org/D144351
</pre>
</div>
</content>
</entry>
<entry>
<title>llvm-tblgen: Move decl of `EmitDecoder()`to TableGenBackends.h</title>
<updated>2023-03-21T07:21:27+00:00</updated>
<author>
<name>NAKAMURA Takumi</name>
<email>geek4civic@gmail.com</email>
</author>
<published>2023-02-20T14:02:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f35064dbe993708cad39234ced0b7c4b01c98ae2'/>
<id>f35064dbe993708cad39234ced0b7c4b01c98ae2</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D144351
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D144351
</pre>
</div>
</content>
</entry>
<entry>
<title>llvm-tblgen: Add "TableGenBackends.h" to each emitter.</title>
<updated>2023-02-18T18:06:32+00:00</updated>
<author>
<name>NAKAMURA Takumi</name>
<email>geek4civic@gmail.com</email>
</author>
<published>2023-02-18T17:52:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=aeafcbcd75f2338cacfb2d2c2a538a6e3b6a38e7'/>
<id>aeafcbcd75f2338cacfb2d2c2a538a6e3b6a38e7</id>
<content type='text'>
"TableGenBackends.h" has declarations of emitters.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"TableGenBackends.h" has declarations of emitters.
</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm-tblgen] NFC: Simplify DecoderEmitter.</title>
<updated>2022-10-28T23:45:20+00:00</updated>
<author>
<name>James Y Knight</name>
<email>jyknight@google.com</email>
</author>
<published>2022-10-28T22:38:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9a26f8931657be611b0111e604610ac967aa5b62'/>
<id>9a26f8931657be611b0111e604610ac967aa5b62</id>
<content type='text'>
Currently the DecoderEmitter constructor takes a bunch of string
parameters containing bits of code to interpolate.

However, there's only two ways it can be called. The one used for most
targets which doesn't handle the SoftFail DecoderStatus (not a
problem, because they don't use SoftFail). The other mode, which is
used for ARM/AArch64, does handle SoftFail, but requires an externally
defined helper function in those targets.

This is unnecessary complication; remove the parameters, and unify
onto a single version which does support SoftFail, defining the helper
itself.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently the DecoderEmitter constructor takes a bunch of string
parameters containing bits of code to interpolate.

However, there's only two ways it can be called. The one used for most
targets which doesn't handle the SoftFail DecoderStatus (not a
problem, because they don't use SoftFail). The other mode, which is
used for ARM/AArch64, does handle SoftFail, but requires an externally
defined helper function in those targets.

This is unnecessary complication; remove the parameters, and unify
onto a single version which does support SoftFail, defining the helper
itself.
</pre>
</div>
</content>
</entry>
</feed>
