<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/test/CodeGen/WebAssembly, 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>[WebAssembly] Fold TargetGlobalAddress with added offset (#145829)</title>
<updated>2025-07-03T10:01:36+00:00</updated>
<author>
<name>jjasmine</name>
<email>jjasmine@igalia.com</email>
</author>
<published>2025-07-03T10:01:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cbc2ac5db8ead660f1c264b6eb1e374665e4c152'/>
<id>cbc2ac5db8ead660f1c264b6eb1e374665e4c152</id>
<content type='text'>
Previously we only folded TargetGlobalAddresses into the memarg if they
were on their own, so this patch supports folding TargetGlobalAddresses
that are added to some other offset.

Previously we weren't able to do this because we didn't have nuw on the
add, but we can now that getelementptr has nuw and is plumbed through to
the add in 0564d0665b302d1c7861e03d2995612f46613a0f.

Fixes #61930</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously we only folded TargetGlobalAddresses into the memarg if they
were on their own, so this patch supports folding TargetGlobalAddresses
that are added to some other offset.

Previously we weren't able to do this because we didn't have nuw on the
add, but we can now that getelementptr has nuw and is plumbed through to
the add in 0564d0665b302d1c7861e03d2995612f46613a0f.

Fixes #61930</pre>
</div>
</content>
</entry>
<entry>
<title>WebAssembly: Move validation of EH flags to TargetMachine construct time (#146634)</title>
<updated>2025-07-02T22:25:38+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2025-07-02T22:25:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6ab7e52dd80dc2ece12cc7f1924a71f1a58e2a8a'/>
<id>6ab7e52dd80dc2ece12cc7f1924a71f1a58e2a8a</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] Fix inline assembly with vector types (#146574)</title>
<updated>2025-07-02T03:26:30+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2025-07-02T03:26:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a8a9a7f95a695c02bdf3d5821d1c62cc8e08c2ff'/>
<id>a8a9a7f95a695c02bdf3d5821d1c62cc8e08c2ff</id>
<content type='text'>
This commit fixes using inline assembly with v128 results. Previously
this failed with an internal assertion about a failure to legalize a
`CopyFromReg` where the source register was typed `v8f16`. It looks like
the type used for the destination register was whatever was listed first
in the `def V128 : WebAssemblyRegClass` listing, so the types were
shuffled around to have a default-supported type.

A small test was added as well which failed to generate previously and
should now pass in generation. This test passed on LLVM 18 additionally
and regressed by accident in #93228 which was first included in LLVM 19.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit fixes using inline assembly with v128 results. Previously
this failed with an internal assertion about a failure to legalize a
`CopyFromReg` where the source register was typed `v8f16`. It looks like
the type used for the destination register was whatever was listed first
in the `def V128 : WebAssemblyRegClass` listing, so the types were
shuffled around to have a default-supported type.

A small test was added as well which failed to generate previously and
should now pass in generation. This test passed on LLVM 18 additionally
and regressed by accident in #93228 which was first included in LLVM 19.</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] Fold any/alltrue (setcc x, 0, eq/ne) to [not] any/alltrue x (#144741)</title>
<updated>2025-07-01T22:27:37+00:00</updated>
<author>
<name>jjasmine</name>
<email>jjasmine@igalia.com</email>
</author>
<published>2025-07-01T22:27:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e9c9f8f3748a1666dfd099da7990ebe4523778bf'/>
<id>e9c9f8f3748a1666dfd099da7990ebe4523778bf</id>
<content type='text'>
Fixes https://github.com/llvm/llvm-project/issues/50142, a miss of
further vectorization, where we can only achieve zext (xor (any_true),
-1).

Now in test case simd-setcc-reductions, it's converted to all_true.

Also fixes https://github.com/llvm/llvm-project/issues/145177, which is

all_true (setcc x, 0, eq) -&gt; not any_true
any_true (setcc x, 0, ne) -&gt; any_true
all_true (setcc x, 0, ne) -&gt; all_true

---------

Co-authored-by: badumbatish &lt;--show-origin&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes https://github.com/llvm/llvm-project/issues/50142, a miss of
further vectorization, where we can only achieve zext (xor (any_true),
-1).

Now in test case simd-setcc-reductions, it's converted to all_true.

Also fixes https://github.com/llvm/llvm-project/issues/145177, which is

all_true (setcc x, 0, eq) -&gt; not any_true
any_true (setcc x, 0, ne) -&gt; any_true
all_true (setcc x, 0, ne) -&gt; all_true

---------

Co-authored-by: badumbatish &lt;--show-origin&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] [Backend] Wasm optimize illegal bitmask (#145627)</title>
<updated>2025-07-01T22:13:08+00:00</updated>
<author>
<name>jjasmine</name>
<email>jjasmine@igalia.com</email>
</author>
<published>2025-07-01T22:13:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4a8c1f7d127af06642068da56e29178704caf54d'/>
<id>4a8c1f7d127af06642068da56e29178704caf54d</id>
<content type='text'>
[WebAssembly] [Backend] Wasm optimize illegal bitmask for #131980.

Currently, the case for illegal bitmask (v32i8 or v64i8) is that at the
SelectionDag level, two (four) vectors of v128 will be concatenated
together, then they'll all be SETCC by the same pseudo illegal
instruction, which requires expansion later on.

I opt for SETCC-ing them seperately, bitcast and zext them and then add
them up together in the end.

---------

Co-authored-by: badumbatish &lt;--show-origin&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[WebAssembly] [Backend] Wasm optimize illegal bitmask for #131980.

Currently, the case for illegal bitmask (v32i8 or v64i8) is that at the
SelectionDag level, two (four) vectors of v128 will be concatenated
together, then they'll all be SETCC by the same pseudo illegal
instruction, which requires expansion later on.

I opt for SETCC-ing them seperately, bitcast and zext them and then add
them up together in the end.

---------

Co-authored-by: badumbatish &lt;--show-origin&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] Enable a limited amount of stackification for debug code (#136510)</title>
<updated>2025-06-24T18:40:47+00:00</updated>
<author>
<name>SingleAccretion</name>
<email>62474226+SingleAccretion@users.noreply.github.com</email>
</author>
<published>2025-06-24T18:40:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cd46354dbd10820158edabe14dbd49d9f9010722'/>
<id>cd46354dbd10820158edabe14dbd49d9f9010722</id>
<content type='text'>
This change is a step towards fixing one long-standing problem with
LLVM's debug WASM codegen: excessive use of locals. One local for each
temporary value in IR (roughly speaking).

This has a lot of problems:
1) It makes it easy to hit engine limitations of 50K locals with certain
code patterns and large functions.
2) It makes for larger binaries that are slower to load and slower to
compile to native code.
3) It makes certain compilation strategies (spill all WASM locals to
stack, for example) for debug code excessively expensive and makes debug
WASM code either run very slow, or be less debuggable.
4) It slows down LLVM itself.

This change addresses these partially by running a limited version of
the stackification pass for unoptimized code, one that gets rid of the
most 'obviously' unnecessary locals.

Care needs to be taken to not impact LLVM's ability to produce high
quality debug variable locations with this pass. To that end:
1) We only allow stackification when it doesn't require moving any
instructions.
2) We disable stackification of any locals that are used in
DEBUG_VALUEs, or as a frame base.
I have verified on a moderately large example that the baseline and the
diff produce the same kinds (local/global/stack) of locations, and the
only differences are due to the shifting of instruction offsets, with
many local.[get|set]s not being present anymore.

Even with this quite conservative approach, the results are pretty good:
1) 30% reduction in raw code size, up to 10x reduction in the number of
locals for select large methods (~1000 =&gt; ~100).
2) ~10% reduction in instructions retired for an "llc -O0" run on a
moderately sized input.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change is a step towards fixing one long-standing problem with
LLVM's debug WASM codegen: excessive use of locals. One local for each
temporary value in IR (roughly speaking).

This has a lot of problems:
1) It makes it easy to hit engine limitations of 50K locals with certain
code patterns and large functions.
2) It makes for larger binaries that are slower to load and slower to
compile to native code.
3) It makes certain compilation strategies (spill all WASM locals to
stack, for example) for debug code excessively expensive and makes debug
WASM code either run very slow, or be less debuggable.
4) It slows down LLVM itself.

This change addresses these partially by running a limited version of
the stackification pass for unoptimized code, one that gets rid of the
most 'obviously' unnecessary locals.

Care needs to be taken to not impact LLVM's ability to produce high
quality debug variable locations with this pass. To that end:
1) We only allow stackification when it doesn't require moving any
instructions.
2) We disable stackification of any locals that are used in
DEBUG_VALUEs, or as a frame base.
I have verified on a moderately large example that the baseline and the
diff produce the same kinds (local/global/stack) of locations, and the
only differences are due to the shifting of instruction offsets, with
many local.[get|set]s not being present anymore.

Even with this quite conservative approach, the results are pretty good:
1) 30% reduction in raw code size, up to 10x reduction in the number of
locals for select large methods (~1000 =&gt; ~100).
2) ~10% reduction in instructions retired for an "llc -O0" run on a
moderately sized input.</pre>
</div>
</content>
</entry>
<entry>
<title>Introduce MCAsmInfo::UsesSetToEquateSymbol and prefer = to .set</title>
<updated>2025-06-12T05:19:31+00:00</updated>
<author>
<name>Fangrui Song</name>
<email>i@maskray.me</email>
</author>
<published>2025-06-12T05:19:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=28bda778437fea17a25b561f1b3b84545612b565'/>
<id>28bda778437fea17a25b561f1b3b84545612b565</id>
<content type='text'>
Introduce MCAsmInfo::UsesSetToEquateSymbol to control the preferred
syntax for symbol equating. We now favor the more readable and common
`symbol = expression` syntax over `.set`. This aligns with pre- https://reviews.llvm.org/D44256 behavior.

On Apple platforms, this resolves a clang -S vs -c behavior difference (resolves #104623).

For targets whose = support is unconfirmed, UsesSetToEquateSymbol is set to false.
This also minimizes test updates.

Pull Request: https://github.com/llvm/llvm-project/pull/142289
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Introduce MCAsmInfo::UsesSetToEquateSymbol to control the preferred
syntax for symbol equating. We now favor the more readable and common
`symbol = expression` syntax over `.set`. This aligns with pre- https://reviews.llvm.org/D44256 behavior.

On Apple platforms, this resolves a clang -S vs -c behavior difference (resolves #104623).

For targets whose = support is unconfirmed, UsesSetToEquateSymbol is set to false.
This also minimizes test updates.

Pull Request: https://github.com/llvm/llvm-project/pull/142289
</pre>
</div>
</content>
</entry>
<entry>
<title>Reland "[SelectionDAG] Make `(a &amp; x) | (~a &amp; y) -&gt; (a &amp; (x ^ y)) ^ y` available for all targets" (#143651)</title>
<updated>2025-06-11T07:56:37+00:00</updated>
<author>
<name>Iris Shi</name>
<email>0.0@owo.li</email>
</author>
<published>2025-06-11T07:56:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=24d730b3808a562507f3f1f5fc125acf4b6e03aa'/>
<id>24d730b3808a562507f3f1f5fc125acf4b6e03aa</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[SelectionDAG] Make `(a &amp; x) | (~a &amp; y) -&gt; (a &amp; (x ^ y)) ^ y` available for all targets" (#143648)</title>
<updated>2025-06-11T02:19:12+00:00</updated>
<author>
<name>Iris Shi</name>
<email>0.0@owo.li</email>
</author>
<published>2025-06-11T02:19:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8c890eaa3f4cedb494dc2a8180d9c9219bf76900'/>
<id>8c890eaa3f4cedb494dc2a8180d9c9219bf76900</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[SelectionDAG] Make `(a &amp; x) | (~a &amp; y) -&gt; (a &amp; (x ^ y)) ^ y` available for all targets (#137641)</title>
<updated>2025-06-09T09:57:15+00:00</updated>
<author>
<name>Iris Shi</name>
<email>0.0@owo.li</email>
</author>
<published>2025-06-09T09:57:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bfb48363b0c9a2978be9ec2b31dcb32910e0f274'/>
<id>bfb48363b0c9a2978be9ec2b31dcb32910e0f274</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
</feed>
