<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/test/Transforms/ExpandLargeFpConvert, 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>Rename ExpandLargeFpConvertPass to ExpandFpPass (#131128)</title>
<updated>2025-03-14T12:11:45+00:00</updated>
<author>
<name>Frederik Harwath</name>
<email>frederik.harwath@amd.com</email>
</author>
<published>2025-03-14T12:11:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6962cf1700c28d76882e188d8e401486fe051bd4'/>
<id>6962cf1700c28d76882e188d8e401486fe051bd4</id>
<content type='text'>
This is meant as a preparation for PR #130988 "[AMDGPU] Implement IR
expansion for frem instruction" which implements the expansion of
another instruction in this pass. The more general name seems more
appropriate given this change and quite reasonable even without it.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is meant as a preparation for PR #130988 "[AMDGPU] Implement IR
expansion for frem instruction" which implements the expansion of
another instruction in this pass. The more general name seems more
appropriate given this change and quite reasonable even without it.</pre>
</div>
</content>
</entry>
<entry>
<title>[ExpandLargeFpConvert] Scalarize vector types. (#86954)</title>
<updated>2024-04-03T06:45:59+00:00</updated>
<author>
<name>Bevin Hansson</name>
<email>59652494+bevin-hansson@users.noreply.github.com</email>
</author>
<published>2024-04-03T06:45:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7edddee2aa6a6183e40784c9141afec3e2eabb95'/>
<id>7edddee2aa6a6183e40784c9141afec3e2eabb95</id>
<content type='text'>
expand-large-fp-convert cannot handle vector types.
If overly large vector element types survive into
isel, they will likely be scalarized there, but since
isel cannot handle scalar integer types of that size,
it will assert.

Handle vector types in expand-large-fp-convert by
scalarizing them and then expanding the scalar type
operation. For large vectors, this results in a
*massive* code expansion, but it's better than
asserting.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
expand-large-fp-convert cannot handle vector types.
If overly large vector element types survive into
isel, they will likely be scalarized there, but since
isel cannot handle scalar integer types of that size,
it will assert.

Handle vector types in expand-large-fp-convert by
scalarizing them and then expanding the scalar type
operation. For large vectors, this results in a
*massive* code expansion, but it's better than
asserting.</pre>
</div>
</content>
</entry>
<entry>
<title>[ExpandLargeFpConvert] Fix incorrect values in fp-to-int conversion. (#86514)</title>
<updated>2024-03-26T09:08:22+00:00</updated>
<author>
<name>Bevin Hansson</name>
<email>59652494+bevin-hansson@users.noreply.github.com</email>
</author>
<published>2024-03-26T09:08:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=14c30189fb8782535ac9a5a52160e3fc62e7e78c'/>
<id>14c30189fb8782535ac9a5a52160e3fc62e7e78c</id>
<content type='text'>
The IR for a double-to-i129 conversion looks like this in one of the
blocks in compiler-rt:

  %cmp5.i = icmp ult i16 %3, -129, !dbg !24

But in ExpandLargeFpConvert, it looks like:

  %13 = icmp ult i129 %12, 4294967167, !dbg !19

ExpandLargeFpConvert is wrong; the value should have been
signed before negating, but instead we get a very large
unsigned value. Another value in the same pass also has this
issue.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The IR for a double-to-i129 conversion looks like this in one of the
blocks in compiler-rt:

  %cmp5.i = icmp ult i16 %3, -129, !dbg !24

But in ExpandLargeFpConvert, it looks like:

  %13 = icmp ult i129 %12, 4294967167, !dbg !19

ExpandLargeFpConvert is wrong; the value should have been
signed before negating, but instead we get a very large
unsigned value. Another value in the same pass also has this
issue.</pre>
</div>
</content>
</entry>
<entry>
<title>[ExpandLargeFpConvert] Fix bug in int-to-fp expansion. (#85370)</title>
<updated>2024-03-15T11:42:23+00:00</updated>
<author>
<name>Bevin Hansson</name>
<email>59652494+bevin-hansson@users.noreply.github.com</email>
</author>
<published>2024-03-15T11:42:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f623adbbbdea8ac6af06e44be218e4fa969e523d'/>
<id>f623adbbbdea8ac6af06e44be218e4fa969e523d</id>
<content type='text'>
When deciding whether to perform rounding on the significand,
the generated IR was using (width - leading zeros - 1) rather
than (width - leading zeros). This is different from how the
routine in compiler-rt does it:

    int sd = srcBits - clzSrcT(a);
    int e = sd - 1;
    if (sd &gt; dstMantDig) {

This bug means that the following code, when built on -O0:

    #include &lt;stdio.h&gt;

    _BitInt(233) v_1037 = 0;

    int main(void)
    {
        v_1037 = 18014398509481982wb;
        double d = v_1037;
        printf("d = %f\n", d);

        return 0;
    }

prints "d = 9007199254740992.000000", which is incorrect.
The correct result is "d = 18014398509481982.000000".</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When deciding whether to perform rounding on the significand,
the generated IR was using (width - leading zeros - 1) rather
than (width - leading zeros). This is different from how the
routine in compiler-rt does it:

    int sd = srcBits - clzSrcT(a);
    int e = sd - 1;
    if (sd &gt; dstMantDig) {

This bug means that the following code, when built on -O0:

    #include &lt;stdio.h&gt;

    _BitInt(233) v_1037 = 0;

    int main(void)
    {
        v_1037 = 18014398509481982wb;
        double d = v_1037;
        printf("d = %f\n", d);

        return 0;
    }

prints "d = 9007199254740992.000000", which is incorrect.
The correct result is "d = 18014398509481982.000000".</pre>
</div>
</content>
</entry>
<entry>
<title>CodeGen: Port ExpandLargeFpConvert to new PM (#71027)</title>
<updated>2023-11-03T05:23:30+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2023-11-02T06:06:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3cef582ae430fb912f1d089fab7c64e77d40fcf9'/>
<id>3cef582ae430fb912f1d089fab7c64e77d40fcf9</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>X86: Move ExpandLargeFpConvert tests to test/Transforms</title>
<updated>2023-11-02T06:50:31+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2023-11-02T05:54:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5a9b99630b4934b194f2cbc67329e0665172ac6c'/>
<id>5a9b99630b4934b194f2cbc67329e0665172ac6c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
