<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/test/Transforms/UnifyLoopExits, 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>[Transforms] Refactor CreateControlFlowHub (#103013)</title>
<updated>2024-08-22T06:48:01+00:00</updated>
<author>
<name>Sameer Sahasrabuddhe</name>
<email>sameer.sahasrabuddhe@amd.com</email>
</author>
<published>2024-08-22T06:13:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5f6172f0684b6a224d207ff8d093fc9aad92e331'/>
<id>5f6172f0684b6a224d207ff8d093fc9aad92e331</id>
<content type='text'>
CreateControlFlowHub is a method that redirects control flow edges from a set of
incoming blocks to a set of outgoing blocks through a new set of "guard" blocks.
This is now refactored into a separate file with one enhancement: The input to
the method is now a set of branches rather than two sets of blocks.

The original implementation reroutes every edge from incoming blocks to outgoing
blocks. But it is possible that for some incoming block InBB, some successor S
might be in the set of outgoing blocks, but that particular edge should not be
rerouted. The new implementation makes this possible by allowing the user to
specify the targets of each branch that need to be rerouted.

This is needed when improving the implementation of FixIrreducible #101386.
Current use in FixIrreducible does not demonstrate this finer control over the
edges being rerouted. But in UnifyLoopExits, when only one successor of an
exiting block is an exit block, this refinement now reroutes only the relevant
control-flow through the edge; the non-exit successor is not rerouted. This
results in fewer branches and PHI nodes in the hub.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
CreateControlFlowHub is a method that redirects control flow edges from a set of
incoming blocks to a set of outgoing blocks through a new set of "guard" blocks.
This is now refactored into a separate file with one enhancement: The input to
the method is now a set of branches rather than two sets of blocks.

The original implementation reroutes every edge from incoming blocks to outgoing
blocks. But it is possible that for some incoming block InBB, some successor S
might be in the set of outgoing blocks, but that particular edge should not be
rerouted. The new implementation makes this possible by allowing the user to
specify the targets of each branch that need to be rerouted.

This is needed when improving the implementation of FixIrreducible #101386.
Current use in FixIrreducible does not demonstrate this finer control over the
edges being rerouted. But in UnifyLoopExits, when only one successor of an
exiting block is an exit block, this refinement now reroutes only the relevant
control-flow through the edge; the non-exit successor is not rerouted. This
results in fewer branches and PHI nodes in the hub.
</pre>
</div>
</content>
</entry>
<entry>
<title>[UnifyLoopExits] Never generate phis of only `undef` values (#99924)</title>
<updated>2024-07-23T16:28:37+00:00</updated>
<author>
<name>Johannes Doerfert</name>
<email>johannes@jdoerfert.de</email>
</author>
<published>2024-07-23T16:28:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f227dc9ca24296cec0878b92d5ad3f853417e264'/>
<id>f227dc9ca24296cec0878b92d5ad3f853417e264</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Pass] Add hyphen to some pass names (#74287)</title>
<updated>2024-01-25T08:05:54+00:00</updated>
<author>
<name>paperchalice</name>
<email>liujunchang97@outlook.com</email>
</author>
<published>2024-01-25T08:05:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e390c229a438ed1eb3396df8fbeeda89c49474e6'/>
<id>e390c229a438ed1eb3396df8fbeeda89c49474e6</id>
<content type='text'>
Here is the list of the renamed passes:
- `callbrprepare` -&gt; `callbr-prepare`
- `dwarfehprepare` -&gt; `dwarf-eh-prepare`
- `flattencfg` -&gt; `flatten-cfg`
- `loweratomic` -&gt; `lower-atomic`
- `lowerinvoke` -&gt; `lower-invoke`
- `lowerswitch` -&gt; `lower-switch`
- `winehprepare` -&gt; `win-eh-prepare`
- `targetir` -&gt; `target-ir`
- `targetlibinfo` -&gt; `target-lib-info`

Legacy passes are not affected.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Here is the list of the renamed passes:
- `callbrprepare` -&gt; `callbr-prepare`
- `dwarfehprepare` -&gt; `dwarf-eh-prepare`
- `flattencfg` -&gt; `flatten-cfg`
- `loweratomic` -&gt; `lower-atomic`
- `lowerinvoke` -&gt; `lower-invoke`
- `lowerswitch` -&gt; `lower-switch`
- `winehprepare` -&gt; `win-eh-prepare`
- `targetir` -&gt; `target-ir`
- `targetlibinfo` -&gt; `target-lib-info`

Legacy passes are not affected.</pre>
</div>
</content>
</entry>
<entry>
<title>[UnifyLoopExits] Use poison instead of undef as placeholder [NFC]</title>
<updated>2023-07-22T21:38:10+00:00</updated>
<author>
<name>Nuno Lopes</name>
<email>nuno.lopes@tecnico.ulisboa.pt</email>
</author>
<published>2023-07-22T21:38:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9007d0e0b6456424d81c89cf78ca9a3b01a61fed'/>
<id>9007d0e0b6456424d81c89cf78ca9a3b01a61fed</id>
<content type='text'>
This pass creates phi nodes where only one of the incoming values is used.
The remaining ones can be poison.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This pass creates phi nodes where only one of the incoming values is used.
The remaining ones can be poison.
</pre>
</div>
</content>
</entry>
<entry>
<title>[UnifyLoopExits] Convert test to opaque pointers (NFC)</title>
<updated>2023-01-04T15:16:57+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-01-04T15:13:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d091506cd0fff2a5649b94d1863d2bd0ed1888aa'/>
<id>d091506cd0fff2a5649b94d1863d2bd0ed1888aa</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[BasicBlockUtils] Add a new way for CreateControlFlowHub()</title>
<updated>2022-10-31T13:58:54+00:00</updated>
<author>
<name>Brendon Cahoon</name>
<email>brendon.cahoon@amd.com</email>
</author>
<published>2022-10-09T22:34:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f59205aef957da9017285d4c0bb6f9c6f244621f'/>
<id>f59205aef957da9017285d4c0bb6f9c6f244621f</id>
<content type='text'>
The existing way of creating the predicate in the guard blocks uses
a boolean value per outgoing block. This increases the number of live
booleans as the number of outgoing blocks increases. The new way added
in this change is to store one integer to represent the outgoing block
we want to branch to, then at each guard block, an integer equality
check is performed to decide which a specific outgoing block is taken.

Using an integer reduces the number of live values and decreases
register pressure especially in cases where there are a large number
of outgoing blocks. The integer based approach is used when the
number of outgoing blocks crosses a threshold, which is currently set
to 32.

Patch by Ruiling Song.

Differential review: https://reviews.llvm.org/D127831
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The existing way of creating the predicate in the guard blocks uses
a boolean value per outgoing block. This increases the number of live
booleans as the number of outgoing blocks increases. The new way added
in this change is to store one integer to represent the outgoing block
we want to branch to, then at each guard block, an integer equality
check is performed to decide which a specific outgoing block is taken.

Using an integer reduces the number of live values and decreases
register pressure especially in cases where there are a large number
of outgoing blocks. The integer based approach is used when the
number of outgoing blocks crosses a threshold, which is currently set
to 32.

Patch by Ruiling Song.

Differential review: https://reviews.llvm.org/D127831
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC][1/n] Remove -enable-new-pm=0 flags from lit tests</title>
<updated>2022-09-19T16:57:37+00:00</updated>
<author>
<name>Sebastian Peryt</name>
<email>sebastian.peryt@intel.com</email>
</author>
<published>2022-09-19T16:28:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=99c9b37d115390e24e6f9b877244466b9856552c'/>
<id>99c9b37d115390e24e6f9b877244466b9856552c</id>
<content type='text'>
This is the first patch in a series intended for removing flag
-enable-new-pm=0 from lit tests. This is part of a bigger
effort of completely removing legacy code related to legacy
pass manager in favor of currently default new pass manager.

In this patch flag has been removed only from tests where no significant
change has been required because checks has been duplicated for
both PMs.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D134150
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the first patch in a series intended for removing flag
-enable-new-pm=0 from lit tests. This is part of a bigger
effort of completely removing legacy code related to legacy
pass manager in favor of currently default new pass manager.

In this patch flag has been removed only from tests where no significant
change has been required because checks has been duplicated for
both PMs.

Reviewed By: fhahn

Differential Revision: https://reviews.llvm.org/D134150
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[UnifyLoopExits] Reduce number of guard blocks"</title>
<updated>2022-07-14T15:33:52+00:00</updated>
<author>
<name>Brendon Cahoon</name>
<email>brendon.cahoon@amd.com</email>
</author>
<published>2022-07-14T14:47:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=58fec78231dc29bd503ba91d06471c94851d21a0'/>
<id>58fec78231dc29bd503ba91d06471c94851d21a0</id>
<content type='text'>
This reverts commit e13248ab0e79b59d5e5ac73e2fe57d82ce485ce1.

Need to revert because the transformation cannot occur for basic
blocks that contain convergent instructions.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit e13248ab0e79b59d5e5ac73e2fe57d82ce485ce1.

Need to revert because the transformation cannot occur for basic
blocks that contain convergent instructions.
</pre>
</div>
</content>
</entry>
<entry>
<title>[UnifyLoopExits] Reduce number of guard blocks</title>
<updated>2022-06-22T20:44:23+00:00</updated>
<author>
<name>Brendon Cahoon</name>
<email>brendon.cahoon@amd.com</email>
</author>
<published>2022-04-06T01:53:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e13248ab0e79b59d5e5ac73e2fe57d82ce485ce1'/>
<id>e13248ab0e79b59d5e5ac73e2fe57d82ce485ce1</id>
<content type='text'>
UnifyLoopExits creates a single exit, a control flow hub, for
loops with multiple exits. There is an input to the block for
each loop exiting block and an output from the block for each
loop exit block. Multiple checks, or guard blocks, are needed
to branch to the correct exit block.

For large loops with lots of exit blocks, all the extra guard
blocks cause problems for StructurizeCFG and subsequent passes.
This patch reduces the number of guard blocks needed when the
exit blocks branch to a common block (e.g., an unreachable
block). The guard blocks are reduced by changing the inputs
and outputs of the control flow hub. The inputs are the exit
blocks and the outputs are the common block.

Reducing the guard blocks enables StructurizeCFG to reorder the
basic blocks in the CFG to reduce the values that exit a loop
with multiple exits. This reduces the compile-time of
StructurizeCFG and also reduces register pressure.

Differential Revision: https://reviews.llvm.org/D123230
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
UnifyLoopExits creates a single exit, a control flow hub, for
loops with multiple exits. There is an input to the block for
each loop exiting block and an output from the block for each
loop exit block. Multiple checks, or guard blocks, are needed
to branch to the correct exit block.

For large loops with lots of exit blocks, all the extra guard
blocks cause problems for StructurizeCFG and subsequent passes.
This patch reduces the number of guard blocks needed when the
exit blocks branch to a common block (e.g., an unreachable
block). The guard blocks are reduced by changing the inputs
and outputs of the control flow hub. The inputs are the exit
blocks and the outputs are the common block.

Reducing the guard blocks enables StructurizeCFG to reorder the
basic blocks in the CFG to reduce the values that exit a loop
with multiple exits. This reduces the compile-time of
StructurizeCFG and also reduces register pressure.

Differential Revision: https://reviews.llvm.org/D123230
</pre>
</div>
</content>
</entry>
<entry>
<title>LowerSwitch: Avoid inserting NewDefault block</title>
<updated>2022-04-14T05:30:56+00:00</updated>
<author>
<name>Ruiling Song</name>
<email>ruiling.song@amd.com</email>
</author>
<published>2022-04-12T03:25:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1e01f95057a702658a88879223586fde0122f038'/>
<id>1e01f95057a702658a88879223586fde0122f038</id>
<content type='text'>
The NewDefault was used to simplify the updating of PHI nodes, but it
causes some inefficiency for target that will run structurizer later. For
example, for a simple two-case switch, the extra NewDefault is causing
unstructured CFG like:

        O
       / \
      O   O
     / \ / \
    C1  ND C2
     \  |  /
      \ | /
        D

The change is to avoid the ND(NewDefault) block, that is we will get a
structured CFG for above example like:

        O
       / \
      /   \
     O     O
    / \   / \
   C1  \ /  C2
    \-&gt; D &lt;-/

The IR change introduced by this patch should be trivial to other targets,
so I am doing this unconditionally.

Fall-through among the cases will also cause unstructured CFG, but it need
more work and will be addressed in a separate change.

Reviewed by: arsenm

Differential Revision: https://reviews.llvm.org/D123607
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The NewDefault was used to simplify the updating of PHI nodes, but it
causes some inefficiency for target that will run structurizer later. For
example, for a simple two-case switch, the extra NewDefault is causing
unstructured CFG like:

        O
       / \
      O   O
     / \ / \
    C1  ND C2
     \  |  /
      \ | /
        D

The change is to avoid the ND(NewDefault) block, that is we will get a
structured CFG for above example like:

        O
       / \
      /   \
     O     O
    / \   / \
   C1  \ /  C2
    \-&gt; D &lt;-/

The IR change introduced by this patch should be trivial to other targets,
so I am doing this unconditionally.

Fall-through among the cases will also cause unstructured CFG, but it need
more work and will be addressed in a separate change.

Reviewed by: arsenm

Differential Revision: https://reviews.llvm.org/D123607
</pre>
</div>
</content>
</entry>
</feed>
