[PATCH] D99171: [WebAssembly] Fold xor by inverting branch target

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 23 04:09:40 PDT 2021


samparker created this revision.
samparker added reviewers: tlively, kripken, sunfish.
Herald added subscribers: ecnelises, hiraditya, jgravelle-google, sbc100, dschuff.
samparker requested review of this revision.
Herald added a subscriber: aheejin.
Herald added a project: LLVM.

I noticed this pattern appearing when running the bullet physics engine on node. Folding away the xor looks beneficial for different architectures and runtimes, speedups:

| Benchmark | Macbook M1 <https://reviews.llvm.org/M1> (node) | Macbook M1 <https://reviews.llvm.org/M1> (wasmtime) | Ryzen (node) |
| Bullet    | 1.4%             | 0.5%                 | 1%           |
| Adobe     | 2.4%             | 0.8%                 | 2.3%         |
|

I have performed this transformation directly in v8 too and the numbers correlate.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99171

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyInstrControl.td
  llvm/test/CodeGen/WebAssembly/comparisons-f32.ll
  llvm/test/CodeGen/WebAssembly/comparisons-f64.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99171.332602.patch
Type: text/x-patch
Size: 6028 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210323/4a3b2d6d/attachment.bin>


More information about the llvm-commits mailing list