<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp, 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 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] Refactor PerformSETCCCombine (#144875)</title>
<updated>2025-06-25T07:56:35+00:00</updated>
<author>
<name>Sam Parker</name>
<email>sam.parker@arm.com</email>
</author>
<published>2025-06-25T07:56:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d12fb1fc3714627ec526ca95f0e0896ea137abb5'/>
<id>d12fb1fc3714627ec526ca95f0e0896ea137abb5</id>
<content type='text'>
Extract the logic into a templated helper function.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Extract the logic into a templated helper function.</pre>
</div>
</content>
</entry>
<entry>
<title>WebAssembly: Move runtime libcall setting out of TargetLowering (#142624)</title>
<updated>2025-06-16T01:46:05+00:00</updated>
<author>
<name>Matt Arsenault</name>
<email>Matthew.Arsenault@amd.com</email>
</author>
<published>2025-06-16T01:46:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ba7369c49c6f638a4ce6f6be3acbdab5e0b5f418'/>
<id>ba7369c49c6f638a4ce6f6be3acbdab5e0b5f418</id>
<content type='text'>
RuntimeLibcallInfo needs to be correct outside of codegen contexts.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
RuntimeLibcallInfo needs to be correct outside of codegen contexts.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Remove unused local variables (NFC) (#140422)</title>
<updated>2025-05-18T14:31:51+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-18T14:31:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dd702b39699f5f35e862387f88e79e078491094c'/>
<id>dd702b39699f5f35e862387f88e79e078491094c</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Target] Use llvm::max_element (NFC) (#137926)</title>
<updated>2025-05-02T06:44:28+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2025-05-02T06:44:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b4ab53c3b04787f430c2e3484998951c48b05968'/>
<id>b4ab53c3b04787f430c2e3484998951c48b05968</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] Add a missing `break` statement (#133783)</title>
<updated>2025-03-31T19:58:06+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2025-03-31T19:58:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c63246645eeb3fddcf86b36e815c30e8b2af6d44'/>
<id>c63246645eeb3fddcf86b36e815c30e8b2af6d44</id>
<content type='text'>
This fixes an issue introduced in #132430 where a `break;` statement was
accidentally missing causing unintended fall-through.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes an issue introduced in #132430 where a `break;` statement was
accidentally missing causing unintended fall-through.</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] Add more lowerings for wide-arithmetic (#132430)</title>
<updated>2025-03-31T18:36:32+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2025-03-31T18:36:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a415b7f86e8c50e4e789d4651f3231d5078c5859'/>
<id>a415b7f86e8c50e4e789d4651f3231d5078c5859</id>
<content type='text'>
This commit is the result of investigation and discussion on
WebAssembly/wide-arithmetic#6 where alternatives to the `i64.add128`
instruction were discussed but ultimately deferred to a future proposal.
In spite of this though I wanted to apply a few changes to the LLVM
backend here with `wide-arithmetic` enabled for a few minor changes:

* A lowering for the `ISD::UADDO` node is added which uses `add128`
where the upper bits of the two operands are constant zeros and the
result of the 128-bit addition is the result of the overflowing
addition.
* The high bits of a `I64_ADD128` node are now flagged as "known zero"
if the upper bits of the inputs are also zero, assisting this `UADDO`
lowering to ensure the backend knows that the carry result is a 1-bit
result.

A few tests were then added to showcase various lowerings for various
operations that can be done with wide-arithmetic. They don't all
optimize super well at this time but I wanted to add them as a reference
here regardless to have them on-hand for future evaluations if
necessary.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit is the result of investigation and discussion on
WebAssembly/wide-arithmetic#6 where alternatives to the `i64.add128`
instruction were discussed but ultimately deferred to a future proposal.
In spite of this though I wanted to apply a few changes to the LLVM
backend here with `wide-arithmetic` enabled for a few minor changes:

* A lowering for the `ISD::UADDO` node is added which uses `add128`
where the upper bits of the two operands are constant zeros and the
result of the 128-bit addition is the result of the overflowing
addition.
* The high bits of a `I64_ADD128` node are now flagged as "known zero"
if the upper bits of the inputs are also zero, assisting this `UADDO`
lowering to ensure the backend knows that the carry result is a 1-bit
result.

A few tests were then added to showcase various lowerings for various
operations that can be done with wide-arithmetic. They don't all
optimize super well at this time but I wanted to add them as a reference
here regardless to have them on-hand for future evaluations if
necessary.</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] Lower wide SIMD i8 muls (#130785)</title>
<updated>2025-03-21T06:57:57+00:00</updated>
<author>
<name>Sam Parker</name>
<email>sam.parker@arm.com</email>
</author>
<published>2025-03-21T06:57:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=103119a435c9cd1c73da92758a503abee1bac3da'/>
<id>103119a435c9cd1c73da92758a503abee1bac3da</id>
<content type='text'>
Currently, 'wide' i32 simd multiplication, with extended i8 elements,
will perform the multiplication with i32 So, for IR like the following:
```
  %wide.a = sext &lt;8 x i8&gt; %a to &lt;8 x i32&gt;
  %wide.b = sext &lt;8 x i8&gt; %a to &lt;8 x i32&gt;
  %mul = mul &lt;8 x i32&gt; %wide.a, %wide.b
  ret &lt;8 x i32&gt; %mul
```

We would generate the following sequence:
```
  i16x8.extend_low_i8x16_s $push6=, $1
  local.tee $push5=, $3=, $pop6
  i32x4.extmul_low_i16x8_s $push0=, $pop5, $3
  v128.store 0($0), $pop0
  i8x16.shuffle $push1=, $1, $1, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  i16x8.extend_low_i8x16_s $push4=, $pop1
  local.tee $push3=, $1=, $pop4
  i32x4.extmul_low_i16x8_s $push2=, $pop3, $1
  v128.store 16($0), $pop2
  return
```

But now we perform the multiplication with i16, resulting in:
```
  i16x8.extmul_low_i8x16_s $push3=, $1, $1
  local.tee $push2=, $1=, $pop3
  i32x4.extend_high_i16x8_s $push0=, $pop2
  v128.store 16($0), $pop0
  i32x4.extend_low_i16x8_s $push1=, $1
  v128.store 0($0), $pop1
  return
```</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, 'wide' i32 simd multiplication, with extended i8 elements,
will perform the multiplication with i32 So, for IR like the following:
```
  %wide.a = sext &lt;8 x i8&gt; %a to &lt;8 x i32&gt;
  %wide.b = sext &lt;8 x i8&gt; %a to &lt;8 x i32&gt;
  %mul = mul &lt;8 x i32&gt; %wide.a, %wide.b
  ret &lt;8 x i32&gt; %mul
```

We would generate the following sequence:
```
  i16x8.extend_low_i8x16_s $push6=, $1
  local.tee $push5=, $3=, $pop6
  i32x4.extmul_low_i16x8_s $push0=, $pop5, $3
  v128.store 0($0), $pop0
  i8x16.shuffle $push1=, $1, $1, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
  i16x8.extend_low_i8x16_s $push4=, $pop1
  local.tee $push3=, $1=, $pop4
  i32x4.extmul_low_i16x8_s $push2=, $pop3, $1
  v128.store 16($0), $pop2
  return
```

But now we perform the multiplication with i16, resulting in:
```
  i16x8.extmul_low_i8x16_s $push3=, $1, $1
  local.tee $push2=, $1=, $pop3
  i32x4.extend_high_i16x8_s $push0=, $pop2
  v128.store 16($0), $pop0
  i32x4.extend_low_i16x8_s $push1=, $1
  v128.store 0($0), $pop1
  return
```</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] Use the same lowerings for f16x8 as other float vectors. (#127897)</title>
<updated>2025-02-25T19:01:32+00:00</updated>
<author>
<name>Brendan Dahl</name>
<email>brendan.dahl@gmail.com</email>
</author>
<published>2025-02-25T19:01:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9102afcd0146e4e0be7e10ecd6a2537a6960cfcd'/>
<id>9102afcd0146e4e0be7e10ecd6a2537a6960cfcd</id>
<content type='text'>
This fixes failures to select the various compare operations that
weren't being expanded for f16x8.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes failures to select the various compare operations that
weren't being expanded for f16x8.</pre>
</div>
</content>
</entry>
</feed>
