Closed Bug 1741392 Opened 3 years ago Closed 3 years ago

Remove redundant xor64 with all-ones input for wasm-via-Ion

Categories

(Core :: JavaScript: WebAssembly, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: jseward, Assigned: jseward)

References

(Blocks 2 open bugs)

Details

Attachments

(1 file)

Bug 1713092 adds a few MIR folding rules, including ones to remove xor32 with
all-ones inputs. That unfortunately does not generalise to the 64-bit case
because MBitNot is hardwired to Int32, so there's no way to represent the
result.

Fix this, either by allowing MBitNot to also be Int64, or by adding a new
wasm-only path for bit-nots.

Also see bug 1276009 which is closely related or even a dup.

See Also: → 1276009
Blocks: 1741807
No longer blocks: 1741807

Bug 1713092 adds a few MIR folding rules, including ones to remove xor32 with
all-ones inputs. That unfortunately does not generalise to the 64-bit case
because MBitNot is hardwired to Int32, so there's no way to represent the
result. This patch enables MBitNot to also take Int64, enables the relevant
folding rules, and adds LIR-level support for that on {x86,arm}{32,64}.

jit-test/tests/wasm/binop-x64-ion-folding.js, jit-test/tests/wasm/integer.js

  • New test cases.

jit/MIR.h, jit/RangeAnalysis.cpp

  • allow MBitNot to also handle Int64

jit/MIR.cpp

  • MWasmBinaryBitwise::foldsTo: enable folding xor64 with an all-ones input

jit/LIROps.yaml, jit/Lowering.cpp

  • new LIR node BitNotI64, and lowering to it.

jit/arm/Lowering-arm.h, jit/arm/Lowering-arm.cpp, jit/arm/CodeGenerator-arm.cpp
and equivalents for arm64, x64, x32

  • new overload for lowerForALUInt64()
  • new function CodeGenerator::visitBitNotI64()
Pushed by jseward@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/7d2f50ffa706 Remove redundant xor64 with all-ones input for wasm-via-Ion. r=lth,nbp.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 96 Branch
Regressions: 1743547
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: