<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/test/Transforms/SimpleLoopUnswitch/guards.ll, 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] (#118419)</title>
<updated>2024-12-03T20:54:36+00:00</updated>
<author>
<name>Lee Wei</name>
<email>lee10202013@gmail.com</email>
</author>
<published>2024-12-03T20:54:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9bf6365237f3a8a401afc0a69d2fb6d1b809ce68'/>
<id>9bf6365237f3a8a401afc0a69d2fb6d1b809ce68</id>
<content type='text'>
This PR removes tests with `br i1 undef` under
`llvm/tests/Transforms/ObjCARC, Reassociate, SCCP, SLPVectorizer...`.
After this PR, I'll continue to fix tests under `llvm/tests/CodeGen`,
which has more UB tests than `llvm/tests/Transforms`.</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/ObjCARC, Reassociate, SCCP, SLPVectorizer...`.
After this PR, I'll continue to fix tests under `llvm/tests/CodeGen`,
which has more UB tests than `llvm/tests/Transforms`.</pre>
</div>
</content>
</entry>
<entry>
<title>[BBUtils] Don't add 'then' block to a loop if it's terminated with unreachable</title>
<updated>2023-06-19T13:24:30+00:00</updated>
<author>
<name>Dmitry Makogon</name>
<email>d.makogon@g.nsu.ru</email>
</author>
<published>2023-06-08T11:56:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d46d9689f7c3fe16010cd07761858a6392239b3f'/>
<id>d46d9689f7c3fe16010cd07761858a6392239b3f</id>
<content type='text'>
SplitBlockAndInsertIfThen utility creates two new blocks,
they're called ThenBlock and Tail (true and false destinations of a conditional
branch correspondingly). The function has a bool parameter Unreachable,
and if it's set, then ThenBlock is terminated with an unreachable.
At the end of the function the new blocks are added to the loop of the split
block. However, in case ThenBlock is terminated with an unreachable,
it cannot belong to any loop.

Differential Revision: https://reviews.llvm.org/D152434
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SplitBlockAndInsertIfThen utility creates two new blocks,
they're called ThenBlock and Tail (true and false destinations of a conditional
branch correspondingly). The function has a bool parameter Unreachable,
and if it's set, then ThenBlock is terminated with an unreachable.
At the end of the function the new blocks are added to the loop of the split
block. However, in case ThenBlock is terminated with an unreachable,
it cannot belong to any loop.

Differential Revision: https://reviews.llvm.org/D152434
</pre>
</div>
</content>
</entry>
<entry>
<title>[SimpleLoopUnswitch] Verify LoopInfo in turnGuardIntoBranch under a flag</title>
<updated>2023-06-09T06:44:55+00:00</updated>
<author>
<name>Dmitry Makogon</name>
<email>d.makogon@g.nsu.ru</email>
</author>
<published>2023-06-09T06:26:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=995a26d2c7f92c692de6a0ecbc988c004778960f'/>
<id>995a26d2c7f92c692de6a0ecbc988c004778960f</id>
<content type='text'>
A follow-up for 64397d8. Only do verification if VerifyLoopInfo is
set.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
A follow-up for 64397d8. Only do verification if VerifyLoopInfo is
set.
</pre>
</div>
</content>
</entry>
<entry>
<title>[SimpleLoopUnswitch] Verify LoopInfo after turning guards to branches</title>
<updated>2023-06-08T11:29:19+00:00</updated>
<author>
<name>Dmitry Makogon</name>
<email>d.makogon@g.nsu.ru</email>
</author>
<published>2023-06-08T11:27:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=64397d8f25ef6eb1052c20a646589ab9d70cc0d7'/>
<id>64397d8f25ef6eb1052c20a646589ab9d70cc0d7</id>
<content type='text'>
SplitBlockAndInsertIfThen doesn't correctly update LoopInfo when called
with Unreachable=true, which is the case when we turn guards to branches
in SimpleLoopUnswitch.

This adds LoopInfo verification before returning from turnGuardIntoBranch.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
SplitBlockAndInsertIfThen doesn't correctly update LoopInfo when called
with Unreachable=true, which is the case when we turn guards to branches
in SimpleLoopUnswitch.

This adds LoopInfo verification before returning from turnGuardIntoBranch.
</pre>
</div>
</content>
</entry>
<entry>
<title>[SimpleLoopUnswitch] Convert tests to opaque pointers (NFC)</title>
<updated>2023-01-04T15:28:13+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2023-01-04T15:28:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2f79f5438cd6f4fa0fdc32458911c2d163f917c0'/>
<id>2f79f5438cd6f4fa0fdc32458911c2d163f917c0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[NFC] Port all SimpleLoopUnswitch tests to `-passes=` syntax</title>
<updated>2022-12-07T20:15:16+00:00</updated>
<author>
<name>Roman Lebedev</name>
<email>lebedev.ri@gmail.com</email>
</author>
<published>2022-12-07T19:53:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=92e54b09ce076a9e5e109d52e4fff6b1530dcb7a'/>
<id>92e54b09ce076a9e5e109d52e4fff6b1530dcb7a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[SimpleLoopUnswitch] Enable freezing of conditions by default.</title>
<updated>2022-04-25T13:26:41+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2022-04-25T13:26:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6a6cc5542b614e040e88c30baa8c5fc7df169e17'/>
<id>6a6cc5542b614e040e88c30baa8c5fc7df169e17</id>
<content type='text'>
This fixes a series of mis-compiles by SimpleLoopUnswitch.

My measurements showed no performance regression with -O3 on AArch64
in SPEC2006, SPEC2017 and a set of internal benchmarks.

Fixes #50387, #50430

Depends on D124251.

Reviewed By: nikic, aqjune

Differential Revision: https://reviews.llvm.org/D124252
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes a series of mis-compiles by SimpleLoopUnswitch.

My measurements showed no performance regression with -O3 on AArch64
in SPEC2006, SPEC2017 and a set of internal benchmarks.

Fixes #50387, #50430

Depends on D124251.

Reviewed By: nikic, aqjune

Differential Revision: https://reviews.llvm.org/D124252
</pre>
</div>
</content>
</entry>
<entry>
<title>[NewPM] Rename 'unswitch' to 'simple-loop-unswitch' in PassRegistry</title>
<updated>2021-07-09T07:47:33+00:00</updated>
<author>
<name>Bjorn Pettersson</name>
<email>bjorn.a.pettersson@ericsson.com</email>
</author>
<published>2021-07-08T12:12:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1db2551cc1a356a67c0967f424d6158e2ea127e3'/>
<id>1db2551cc1a356a67c0967f424d6158e2ea127e3</id>
<content type='text'>
It is confusing to have two ways of specifying the same pass
('simple-loop-unswitch' and 'unswitch'). This patch replaces
'unswitch' by 'simple-loop-unswitch' to get a unique identifier.

Using 'simple-loop-unswitch' instead of 'unswitch' also has the
advantage of matching how the pass is named in DEBUG_TYPE etc. So
this makes it a bit more consistent how we refer to the pass in
options such as -passes, -print-after and -debug-only.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D105628
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It is confusing to have two ways of specifying the same pass
('simple-loop-unswitch' and 'unswitch'). This patch replaces
'unswitch' by 'simple-loop-unswitch' to get a unique identifier.

Using 'simple-loop-unswitch' instead of 'unswitch' also has the
advantage of matching how the pass is named in DEBUG_TYPE etc. So
this makes it a bit more consistent how we refer to the pass in
options such as -passes, -print-after and -debug-only.

Reviewed By: aeubanks

Differential Revision: https://reviews.llvm.org/D105628
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[SimpleLoopUnswitch] Fix introduction of UB when hoisted condition may be undef or poison"</title>
<updated>2020-02-28T02:10:46+00:00</updated>
<author>
<name>Juneyoung Lee</name>
<email>aqjune@gmail.com</email>
</author>
<published>2020-02-28T02:08:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2b5a8976514de326bb84f0913d9d451089c11d22'/>
<id>2b5a8976514de326bb84f0913d9d451089c11d22</id>
<content type='text'>
.. due to performance regression.

This patch is reverted until infrastructore for CSE/LICM support for freeze is
added.

This reverts commit 181628b
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
.. due to performance regression.

This patch is reverted until infrastructore for CSE/LICM support for freeze is
added.

This reverts commit 181628b
</pre>
</div>
</content>
</entry>
<entry>
<title>[SimpleLoopUnswitch] Fix introduction of UB when hoisted condition may be undef or poison</title>
<updated>2020-02-26T04:47:33+00:00</updated>
<author>
<name>Juneyoung Lee</name>
<email>aqjune@gmail.com</email>
</author>
<published>2020-02-26T02:33:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=181628b52d390f2136fb5a63fe644d230a9b822d'/>
<id>181628b52d390f2136fb5a63fe644d230a9b822d</id>
<content type='text'>
Summary:
Loop unswitch hoists branches on loop-invariant conditions. However, if this
condition is poison/undef and the branch wasn't originally reachable, loop
unswitch introduces UB (since the optimized code will branch on poison/undef and
the original one didn't)).
We fix this problem by freezing the condition to ensure we don't introduce UB.

We will now transform the following:
  while (...) {
    if (C) { A }
    else   { B }
  }

Into:
  C' = freeze(C)
  if (C') {
    while (...) { A }
  } else {
    while (...) { B }
  }

This patch fixes the root cause of the following bug reports (which use the old loop unswitch, but can be reproduced with minor changes in the code and -enable-nontrivial-unswitch):
- https://llvm.org/bugs/show_bug.cgi?id=27506
- https://llvm.org/bugs/show_bug.cgi?id=31652

Reviewers: reames, majnemer, chenli, sanjoy, hfinkel

Reviewed By: reames

Subscribers: hiraditya, jvesely, nhaehnle, filcab, regehr, trentxintong, nlopes, llvm-commits, mzolotukhin

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D29015
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
Loop unswitch hoists branches on loop-invariant conditions. However, if this
condition is poison/undef and the branch wasn't originally reachable, loop
unswitch introduces UB (since the optimized code will branch on poison/undef and
the original one didn't)).
We fix this problem by freezing the condition to ensure we don't introduce UB.

We will now transform the following:
  while (...) {
    if (C) { A }
    else   { B }
  }

Into:
  C' = freeze(C)
  if (C') {
    while (...) { A }
  } else {
    while (...) { B }
  }

This patch fixes the root cause of the following bug reports (which use the old loop unswitch, but can be reproduced with minor changes in the code and -enable-nontrivial-unswitch):
- https://llvm.org/bugs/show_bug.cgi?id=27506
- https://llvm.org/bugs/show_bug.cgi?id=31652

Reviewers: reames, majnemer, chenli, sanjoy, hfinkel

Reviewed By: reames

Subscribers: hiraditya, jvesely, nhaehnle, filcab, regehr, trentxintong, nlopes, llvm-commits, mzolotukhin

Tags: #llvm

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