[all-commits] [llvm/llvm-project] d9ae07: [WebAssembly] Disable register coalescing at -O1

Heejin Ahn via All-commits all-commits at lists.llvm.org
Mon Nov 21 14:16:26 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d9ae0788c432c718af146ffda9c2f6a0ee22007a
      https://github.com/llvm/llvm-project/commit/d9ae0788c432c718af146ffda9c2f6a0ee22007a
  Author: Heejin Ahn <aheejin at gmail.com>
  Date:   2022-11-21 (Mon, 21 Nov 2022)

  Changed paths:
    M llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
    A llvm/test/CodeGen/WebAssembly/regcoalesce-disable.ll

  Log Message:
  -----------
  [WebAssembly] Disable register coalescing at -O1

This disables `RegisterCoalescer` pass at -O1, which currently runs for
all levels except for -O0, as a part of common optimization pipeline.

`RegisterCoalescer` pass degrades Wasm debug info quality by a
significant margin. When I use `LiveDebugValue` analysis, disabling this
increases the average PC ranges covered by 15% on Emscripten core
benchmarks (52% -> 66.8%). (Our code is currently not using
`LiveDebugValues` analysis at the moment, and the experiment was done on
a local setting that enabled it. I'm planning to upstream it soon.)

In Emscripten core benchmarks, disabling this at -O1 causes +4.5% in
code size and +1% in the number of locals. The number of globals stays
the same. I believe this tradeoff is acceptable given that -O1 is not
usually used in production builds and is often used for debugging when
the application size is very large.

The plan is to investigate and fix what's causing the degradation in
that pass, but for now disabling it seems like a low-hanging quick fix.

Reviewed By: dschuff

Differential Revision: https://reviews.llvm.org/D138455




More information about the All-commits mailing list