<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/utils/TableGen/PseudoLoweringEmitter.cpp, branch users/nico/python-1</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>[NFC][TableGen] Add {} for `else` when `if` body has {} (#139420)</title>
<updated>2025-05-12T15:34:12+00:00</updated>
<author>
<name>Rahul Joshi</name>
<email>rjoshi@nvidia.com</email>
</author>
<published>2025-05-12T15:34:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2e8b539e7138122ae6bd54a2dddc296386bd7e28'/>
<id>2e8b539e7138122ae6bd54a2dddc296386bd7e28</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[TableGen] Combine the two separate OperandMapping loops in PseudoLoweringEmitter. (#136007)</title>
<updated>2025-04-16T22:47:16+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2025-04-16T22:47:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b9f1de04f65b062559d01c83dfd3948601924ee1'/>
<id>b9f1de04f65b062559d01c83dfd3948601924ee1</id>
<content type='text'>
Previously we had one loop over the DAG for immediates and registers and
another loop over the destination operands for mapping from the source.

Now we have a single loop over the destination operands that handles immediates,
registers, and named operands. A helper method is added so we can handle
operands and sub-operands specified by a sub-dag.

My goal is to allow a named operand to appear in a sub-dag which wasn't
supported before. This will allow the destination instruction to have an
operand with sub-operands when the source does not have sub operands.

For RISC-V, I'm looking into using an operand with sub-operands to
represent an reg+offset memory address. I need to be able to lower a
pseudo instruction that only has a register operand to an instruction
that has a reg+offset operand. The offset will be filled in with 0
during expansion and the register will be copied from the source.

The expansion would look like this:
def PseudoCALLIndirect : Pseudo&lt;(outs), (ins GPRJALR:$rs1),
                                [(riscv_call GPRJALR:$rs1)]&gt;,
PseudoInstExpansion&lt;(JALR X1, (ops GPR:$rs1, 0))&gt;;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously we had one loop over the DAG for immediates and registers and
another loop over the destination operands for mapping from the source.

Now we have a single loop over the destination operands that handles immediates,
registers, and named operands. A helper method is added so we can handle
operands and sub-operands specified by a sub-dag.

My goal is to allow a named operand to appear in a sub-dag which wasn't
supported before. This will allow the destination instruction to have an
operand with sub-operands when the source does not have sub operands.

For RISC-V, I'm looking into using an operand with sub-operands to
represent an reg+offset memory address. I need to be able to lower a
pseudo instruction that only has a register operand to an instruction
that has a reg+offset operand. The offset will be filled in with 0
during expansion and the register will be copied from the source.

The expansion would look like this:
def PseudoCALLIndirect : Pseudo&lt;(outs), (ins GPRJALR:$rs1),
                                [(riscv_call GPRJALR:$rs1)]&gt;,
PseudoInstExpansion&lt;(JALR X1, (ops GPR:$rs1, 0))&gt;;</pre>
</div>
</content>
</entry>
<entry>
<title>[TableGen] Store flat source operand number in OperandMap in PseudoLoweringEmitter. NFC (#135886)</title>
<updated>2025-04-16T16:39:52+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2025-04-16T16:39:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=76b5fcbf975547251faaeed8b567ea09d139a607'/>
<id>76b5fcbf975547251faaeed8b567ea09d139a607</id>
<content type='text'>
Previously we stored the index into the source CodeGenInstruction's
operand list. Any operand with sub operands stored the same index into
all of the OperandMap entries for that operand. The emitting loop would
look up the MIOperandNo for the source and add the sub index.

This patch moves the logic into the loop that updates the OperandMap.
Now the emitting loop only needs to print the value.

While there, I've added a check that MIOperandNo is the same for source
and destination.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously we stored the index into the source CodeGenInstruction's
operand list. Any operand with sub operands stored the same index into
all of the OperandMap entries for that operand. The emitting loop would
look up the MIOperandNo for the source and add the sub index.

This patch moves the logic into the loop that updates the OperandMap.
Now the emitting loop only needs to print the value.

While there, I've added a check that MIOperandNo is the same for source
and destination.</pre>
</div>
</content>
</entry>
<entry>
<title>[TableGen] Remove unhelpful error messages from PseudoLoweringEmitter. (#135747)</title>
<updated>2025-04-15T15:41:39+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2025-04-15T15:41:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=88b6229dc3f65876b3f627616a024cd5dbcadcb0'/>
<id>88b6229dc3f65876b3f627616a024cd5dbcadcb0</id>
<content type='text'>
All of the notes using the location of ResultInst will just print the
location inside of the PseudoInstExpansion class.

There was one note using the location of DI-&gt;getDef(), but knowing where
one of the two mismatched types is defined isn't helpful. The operand
types need to be the same, so the mismatch message we already printed
should be enough.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All of the notes using the location of ResultInst will just print the
location inside of the PseudoInstExpansion class.

There was one note using the location of DI-&gt;getDef(), but knowing where
one of the two mismatched types is defined isn't helpful. The operand
types need to be the same, so the mismatch message we already printed
should be enough.</pre>
</div>
</content>
</entry>
<entry>
<title>[TableGen] Accurately calculate where the source variable ops start in PseudoLoweringEmitter::emitLoweringEmitter. (#135465)</title>
<updated>2025-04-12T17:00:56+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2025-04-12T17:00:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=009971a0d3218d3af0d10fb70d2c876ccc46b24d'/>
<id>009971a0d3218d3af0d10fb70d2c876ccc46b24d</id>
<content type='text'>
The code was using the number of source operands plus one. The plus one
seems to be an ARM specific value accounting for one of the source
operands having 2 sub operands. No other target in tree uses
PseudoLowering with variadic instructions so this worked.

This patch replaces it with a proper count of the number of sub operands
of all operands. While there I update the loop to use MIOperandNo so we
don't need to count up the sub operands as we go.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The code was using the number of source operands plus one. The plus one
seems to be an ARM specific value accounting for one of the source
operands having 2 sub operands. No other target in tree uses
PseudoLowering with variadic instructions so this worked.

This patch replaces it with a proper count of the number of sub operands
of all operands. While there I update the loop to use MIOperandNo so we
don't need to count up the sub operands as we go.</pre>
</div>
</content>
</entry>
<entry>
<title>[TableGen] Remove unneeded FIXME. NFC</title>
<updated>2025-04-12T04:37:35+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2025-04-12T02:55:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6bea80e93fcba89a6b3a8312cc0a3c3f528b284a'/>
<id>6bea80e93fcba89a6b3a8312cc0a3c3f528b284a</id>
<content type='text'>
The message looks correct to me.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The message looks correct to me.
</pre>
</div>
</content>
</entry>
<entry>
<title>[TableGen] Avoid repeated hash lookups (NFC) (#126405)</title>
<updated>2025-02-09T16:56:17+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-02-09T16:56:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=87ae9547ea0f590f8adbbdfaeca28ef999ddffa8'/>
<id>87ae9547ea0f590f8adbbdfaeca28ef999ddffa8</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[TableGen] [NFC] Remove unused includes in TableGen BE (#113725)</title>
<updated>2024-10-29T03:26:10+00:00</updated>
<author>
<name>Jerry Sun</name>
<email>105613447+jerryyiransun@users.noreply.github.com</email>
</author>
<published>2024-10-29T03:26:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=00ca2071e08f3a82171e564618981906a15e8dca'/>
<id>00ca2071e08f3a82171e564618981906a15e8dca</id>
<content type='text'>
split PR as requested from
https://github.com/llvm/llvm-project/pull/113318.

Removes unused imports in TableGen BE</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
split PR as requested from
https://github.com/llvm/llvm-project/pull/113318.

Removes unused imports in TableGen BE</pre>
</div>
</content>
</entry>
<entry>
<title>[TableGen] Factor out timer code into a new `TGTimer` class (#111054)</title>
<updated>2024-10-04T16:23:55+00:00</updated>
<author>
<name>Rahul Joshi</name>
<email>rjoshi@nvidia.com</email>
</author>
<published>2024-10-04T16:23:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d883ef10767c5ac22b43f7f9f49e4565e7ce8263'/>
<id>d883ef10767c5ac22b43f7f9f49e4565e7ce8263</id>
<content type='text'>
Factor out the timer related functionality from `RecordKeeper` to a new
`TGTimer` class in a new file.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Factor out the timer related functionality from `RecordKeeper` to a new
`TGTimer` class in a new file.</pre>
</div>
</content>
</entry>
<entry>
<title>[LLVM][TableGen] Change PseudoLoweringEmitter to use const RecordKeeper (#109194)</title>
<updated>2024-09-19T05:26:48+00:00</updated>
<author>
<name>Rahul Joshi</name>
<email>rjoshi@nvidia.com</email>
</author>
<published>2024-09-19T05:26:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7603e854295baeabeaa2c7ffcf187c9c53def822'/>
<id>7603e854295baeabeaa2c7ffcf187c9c53def822</id>
<content type='text'>
Change PseudoLoweringEmitter 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 PseudoLoweringEmitter 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>
</feed>
