<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Transforms/Scalar/Float2Int.cpp, branch main</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>[Float2Int] Make sure the CFP can be represented in the integer type (#167699)</title>
<updated>2025-11-13T12:54:32+00:00</updated>
<author>
<name>Yingwei Zheng</name>
<email>dtcxzyw2333@gmail.com</email>
</author>
<published>2025-11-13T12:54:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=edd8b29667716101ed026baf3aa4befb37ac132a'/>
<id>edd8b29667716101ed026baf3aa4befb37ac132a</id>
<content type='text'>
When `convertToInteger` fails, the integer result is undefined. In this
case, we cannot use it in the subsequent steps.
Close https://github.com/llvm/llvm-project/issues/167627.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When `convertToInteger` fails, the integer result is undefined. In this
case, we cannot use it in the subsequent steps.
Close https://github.com/llvm/llvm-project/issues/167627.</pre>
</div>
</content>
</entry>
<entry>
<title>[EquivClasses] Shorten members_{begin,end} idiom (#134373)</title>
<updated>2025-04-04T13:34:08+00:00</updated>
<author>
<name>Ramkumar Ramachandra</name>
<email>ramkumar.ramachandra@codasip.com</email>
</author>
<published>2025-04-04T13:34:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fd6260f13bfecfb13537e184f4e8365cf35492fd'/>
<id>fd6260f13bfecfb13537e184f4e8365cf35492fd</id>
<content type='text'>
Introduce members() iterator-helper to shorten the members_{begin,end}
idiom. A previous attempt of this patch was #130319, which had to be
reverted due to unit-test failures when attempting to call members() on
the end iterator. In this patch, members() accepts either an ECValue or
an ElemTy, which is more intuitive and doesn't suffer from the same
issue.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce members() iterator-helper to shorten the members_{begin,end}
idiom. A previous attempt of this patch was #130319, which had to be
reverted due to unit-test failures when attempting to call members() on
the end iterator. In this patch, members() accepts either an ECValue or
an ElemTy, which is more intuitive and doesn't suffer from the same
issue.</pre>
</div>
</content>
</entry>
<entry>
<title>[EquivalenceClasses] Use SmallVector for deterministic iteration order. (#134075)</title>
<updated>2025-04-02T19:27:43+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-04-02T19:27:43+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3bdf9a08804a5b424fd32fef3b0089f3a6db839d'/>
<id>3bdf9a08804a5b424fd32fef3b0089f3a6db839d</id>
<content type='text'>
Currently iterators over EquivalenceClasses will iterate over std::set,
which guarantees the order specified by the comperator. Unfortunately in
many cases, EquivalenceClasses are used with pointers, so iterating over
std::set of pointers will not be deterministic across runs.

There are multiple places that explicitly try to sort the equivalence
classes before using them to try to get a deterministic order
(LowerTypeTests, SplitModule), but there are others that do not at the
moment and this can result at least in non-determinstic value naming in
Float2Int.

This patch updates EquivalenceClasses to keep track of all members via a
extra SmallVector and removes code from LowerTypeTests and SplitModule
to sort the classes before processing.

Overall it looks like compile-time slightly decreases in most cases, but
close to noise:

https://llvm-compile-time-tracker.com/compare.php?from=7d441d9892295a6eb8aaf481e1715f039f6f224f&amp;to=b0c2ac67a88d3ef86987e2f82115ea0170675a17&amp;stat=instructions

PR: https://github.com/llvm/llvm-project/pull/134075</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently iterators over EquivalenceClasses will iterate over std::set,
which guarantees the order specified by the comperator. Unfortunately in
many cases, EquivalenceClasses are used with pointers, so iterating over
std::set of pointers will not be deterministic across runs.

There are multiple places that explicitly try to sort the equivalence
classes before using them to try to get a deterministic order
(LowerTypeTests, SplitModule), but there are others that do not at the
moment and this can result at least in non-determinstic value naming in
Float2Int.

This patch updates EquivalenceClasses to keep track of all members via a
extra SmallVector and removes code from LowerTypeTests and SplitModule
to sort the classes before processing.

Overall it looks like compile-time slightly decreases in most cases, but
close to noise:

https://llvm-compile-time-tracker.com/compare.php?from=7d441d9892295a6eb8aaf481e1715f039f6f224f&amp;to=b0c2ac67a88d3ef86987e2f82115ea0170675a17&amp;stat=instructions

PR: https://github.com/llvm/llvm-project/pull/134075</pre>
</div>
</content>
</entry>
<entry>
<title>[EquivalenceClasses] Update member_begin to take ECValue (NFC).</title>
<updated>2025-04-01T08:28:46+00:00</updated>
<author>
<name>Florian Hahn</name>
<email>flo@fhahn.com</email>
</author>
<published>2025-04-01T08:28:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9e5bfbf77db0945f59c0d18012a8e6d43c711b3a'/>
<id>9e5bfbf77db0945f59c0d18012a8e6d43c711b3a</id>
<content type='text'>
Remove a level of indirection and update code to use range-based for
loops.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Remove a level of indirection and update code to use range-based for
loops.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Scalar] Avoid repeated hash lookups (NFC) (#112486)</title>
<updated>2024-10-16T13:41:19+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-10-16T13:41:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9128077c88f0112b4a5b1f64922247793250001b'/>
<id>9128077c88f0112b4a5b1f64922247793250001b</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Float2Int] Avoid repeated hash lookups (NFC) (#107795)</title>
<updated>2024-09-09T14:13:52+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-09-09T14:13:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3940a1ba1454afec916be86385bb2031526e3e13'/>
<id>3940a1ba1454afec916be86385bb2031526e3e13</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[IR] Add getDataLayout() helpers to Function and GlobalValue (#96919)</title>
<updated>2024-06-28T06:36:49+00:00</updated>
<author>
<name>Nikita Popov</name>
<email>npopov@redhat.com</email>
</author>
<published>2024-06-28T06:36:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9df71d7673b5c98e1032d01be83724a45b42fafc'/>
<id>9df71d7673b5c98e1032d01be83724a45b42fafc</id>
<content type='text'>
Similar to https://github.com/llvm/llvm-project/pull/96902, this adds
`getDataLayout()` helpers to Function and GlobalValue, replacing the
current `getParent()-&gt;getDataLayout()` pattern.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Similar to https://github.com/llvm/llvm-project/pull/96902, this adds
`getDataLayout()` helpers to Function and GlobalValue, replacing the
current `getParent()-&gt;getDataLayout()` pattern.</pre>
</div>
</content>
</entry>
<entry>
<title>Reapply: [Float2Int] Resolve FIXME: Pick the smallest legal type that fits (#86337)</title>
<updated>2024-03-25T16:53:38+00:00</updated>
<author>
<name>AtariDreams</name>
<email>83477269+AtariDreams@users.noreply.github.com</email>
</author>
<published>2024-03-25T16:53:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7b3e943dfc6355488a57a7feaa125f4879ba7537'/>
<id>7b3e943dfc6355488a57a7feaa125f4879ba7537</id>
<content type='text'>
Originally reverted because of a bug in Range that is now fixed
(#86041), we can reland this commit. Tests have been added to ensure the
miscompile that caused the revert does not happen again.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Originally reverted because of a bug in Range that is now fixed
(#86041), we can reland this commit. Tests have been added to ensure the
miscompile that caused the revert does not happen again.</pre>
</div>
</content>
</entry>
<entry>
<title>[Float2Int] Fix pessimization in the MinBW calculation. (#86051)</title>
<updated>2024-03-21T18:09:40+00:00</updated>
<author>
<name>Craig Topper</name>
<email>craig.topper@sifive.com</email>
</author>
<published>2024-03-21T18:09:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=796efa8cd5800a42eb8362564be64f3d72512a05'/>
<id>796efa8cd5800a42eb8362564be64f3d72512a05</id>
<content type='text'>
The MinBW was being calculated using the significant bits of the upper
and lower bounds. The upper bound is 1 past the last value in the range
so I don't think it should be included. Instead use ConstantRange::getMinSignedBits.

I'm still not sure if the +1 is needed after the getMinSignedBits call.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The MinBW was being calculated using the significant bits of the upper
and lower bounds. The upper bound is 1 past the last value in the range
so I don't think it should be included. Instead use ConstantRange::getMinSignedBits.

I'm still not sure if the +1 is needed after the getMinSignedBits call.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[Float2Int] Resolve FIXME: Pick the smallest legal type that fits" (#85843)</title>
<updated>2024-03-19T19:15:30+00:00</updated>
<author>
<name>alexfh</name>
<email>alexfh@google.com</email>
</author>
<published>2024-03-19T19:15:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a6e231bb2a7924f4269e6735d29a54b2318cd16c'/>
<id>a6e231bb2a7924f4269e6735d29a54b2318cd16c</id>
<content type='text'>
Reverts llvm/llvm-project#79158, which causes a miscompile. See
https://github.com/llvm/llvm-project/pull/79158#issuecomment-2007842032</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#79158, which causes a miscompile. See
https://github.com/llvm/llvm-project/pull/79158#issuecomment-2007842032</pre>
</div>
</content>
</entry>
</feed>
