<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/test/Transforms/LowerSwitch, 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>[llvm] Remove `br i1 undef` from  some regression tests [NFC] (#117112)</title>
<updated>2024-11-21T08:06:56+00:00</updated>
<author>
<name>Lee Wei</name>
<email>lee10202013@gmail.com</email>
</author>
<published>2024-11-21T08:06:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=abb9f9fa06ef22be2b0287b9047d5cfed71d91d4'/>
<id>abb9f9fa06ef22be2b0287b9047d5cfed71d91d4</id>
<content type='text'>
This PR removes tests with `br i1 undef` under
`llvm/tests/Transforms/Loop*, Lower*`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR removes tests with `br i1 undef` under
`llvm/tests/Transforms/Loop*, Lower*`.</pre>
</div>
</content>
</entry>
<entry>
<title>[LowerSwitch] Use unsigned integer for range comparison (#93237)</title>
<updated>2024-05-27T17:58:22+00:00</updated>
<author>
<name>Peter Rong</name>
<email>peterrong96@gmail.com</email>
</author>
<published>2024-05-27T17:58:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=67aec0cd62d607b4e5b7198769be061454ce67b3'/>
<id>67aec0cd62d607b4e5b7198769be061454ce67b3</id>
<content type='text'>
Commit 1db51d8eb2 switched from int64_t to `APInt` to prevent high precision integer overflow.
However, when comparing the "range" of switch cases, we should switch to unsigned integer to prevent overflow.
This patch fixes https://github.com/llvm/llvm-project/issues/93152. 
Some test cases are added.

Signed-off-by: Peter Rong &lt;PeterRong96@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Commit 1db51d8eb2 switched from int64_t to `APInt` to prevent high precision integer overflow.
However, when comparing the "range" of switch cases, we should switch to unsigned integer to prevent overflow.
This patch fixes https://github.com/llvm/llvm-project/issues/93152. 
Some test cases are added.

Signed-off-by: Peter Rong &lt;PeterRong96@gmail.com&gt;</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>[Transform] Rewrite LowerSwitch using APInt</title>
<updated>2023-01-25T04:22:06+00:00</updated>
<author>
<name>Peter Rong</name>
<email>PeterRong96@gmail.com</email>
</author>
<published>2023-01-12T18:58:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9b70a28e0d767f99bdc778356e81b4d072f59819'/>
<id>9b70a28e0d767f99bdc778356e81b4d072f59819</id>
<content type='text'>
This rewrite fixes https://github.com/llvm/llvm-project/issues/59316.

Previously LowerSwitch uses int64_t, which will crash on case branches using integers with more than 64 bits.
Using APInt fixes this problem. This patch also includes a test

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D140747
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This rewrite fixes https://github.com/llvm/llvm-project/issues/59316.

Previously LowerSwitch uses int64_t, which will crash on case branches using integers with more than 64 bits.
Using APInt fixes this problem. This patch also includes a test

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D140747
</pre>
</div>
</content>
</entry>
<entry>
<title>[Transform] Rewrite LowerSwitch using APInt</title>
<updated>2023-01-05T22:30:42+00:00</updated>
<author>
<name>Peter Rong</name>
<email>PeterRong96@gmail.com</email>
</author>
<published>2022-12-29T00:51:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1db51d8eb2d220a4f0000555ada310990098cf5b'/>
<id>1db51d8eb2d220a4f0000555ada310990098cf5b</id>
<content type='text'>
This rewrite fixes https://github.com/llvm/llvm-project/issues/59316.

Previously LowerSwitch uses int64_t, which will crash on case branches using integers with more than 64 bits.
Using APInt fixes this problem. This patch also includes a test

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D140747
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This rewrite fixes https://github.com/llvm/llvm-project/issues/59316.

Previously LowerSwitch uses int64_t, which will crash on case branches using integers with more than 64 bits.
Using APInt fixes this problem. This patch also includes a test

Reviewed By: RKSimon

Differential Revision: https://reviews.llvm.org/D140747
</pre>
</div>
</content>
</entry>
<entry>
<title>[Transforms] Convert some tests to opaque pointers (NFC)</title>
<updated>2023-01-05T11:43:45+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-01-05T11:35:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=055fb7795aa219a3d274d280ec9129784f169f56'/>
<id>055fb7795aa219a3d274d280ec9129784f169f56</id>
<content type='text'>
These are all tests where conversion worked automatically, and
required no manual fixup.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
These are all tests where conversion worked automatically, and
required no manual fixup.
</pre>
</div>
</content>
</entry>
<entry>
<title>[test] Switch to use -passes syntax in various test cases</title>
<updated>2022-12-01T20:25:59+00:00</updated>
<author>
<name>Bjorn Pettersson</name>
<email>bjorn.a.pettersson@ericsson.com</email>
</author>
<published>2022-12-01T20:00:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a11faeed446882a81e79d780125d93e7199df645'/>
<id>a11faeed446882a81e79d780125d93e7199df645</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</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>
<entry>
<title>[LowerSwitch][NewPM] Port lowerswitch to NPM</title>
<updated>2020-09-16T01:18:31+00:00</updated>
<author>
<name>Arthur Eubanks</name>
<email>aeubanks@google.com</email>
</author>
<published>2020-09-15T22:02:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f7aa1563eb5ff00416fba373073ba19832b6fc34'/>
<id>f7aa1563eb5ff00416fba373073ba19832b6fc34</id>
<content type='text'>
Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D87726
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed By: ychen

Differential Revision: https://reviews.llvm.org/D87726
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix a crash when the default of a switch is removed</title>
<updated>2019-06-03T17:54:15+00:00</updated>
<author>
<name>Andrew Kaylor</name>
<email>andrew.kaylor@intel.com</email>
</author>
<published>2019-06-03T17:54:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4172dbab5dd3dffa8717e090e1912fce598d1a77'/>
<id>4172dbab5dd3dffa8717e090e1912fce598d1a77</id>
<content type='text'>
This patch fixes a problem that occurs in LowerSwitch when a switch statement has a PHI node as its condition, and the PHI node only has two incoming blocks, and one of those incoming blocks is through an unreachable default in the switch statement. When this condition occurs, LowerSwitch holds a pointer to the condition value, but removes the switch block as a predecessor of the PHI block, causing the PHI node to be replaced. LowerSwitch then tries to use its stale pointer to the original condition value, causing a crash.

Differential Revision: https://reviews.llvm.org/D62560

llvm-svn: 362427
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch fixes a problem that occurs in LowerSwitch when a switch statement has a PHI node as its condition, and the PHI node only has two incoming blocks, and one of those incoming blocks is through an unreachable default in the switch statement. When this condition occurs, LowerSwitch holds a pointer to the condition value, but removes the switch block as a predecessor of the PHI block, causing the PHI node to be replaced. LowerSwitch then tries to use its stale pointer to the original condition value, causing a crash.

Differential Revision: https://reviews.llvm.org/D62560

llvm-svn: 362427
</pre>
</div>
</content>
</entry>
</feed>
