[PATCH] D125515: [WebAssembly] Fix register use-def in FixIrreducibleControlFlow

Alon Zakai via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 13 13:01:40 PDT 2022


kripken added inline comments.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp:533
+  }
+}
+
----------------
I'm not that familiar with LLVM, but I am guessing that this code will add an implicit def for each register? That is, this is a change over all the registers used in the function, as opposed to adding definitions in specific blocks for specific registers, and at the top of the function it writes a 0 to all of them?

If so, then I wonder if this has performance implications? Specifically I worry about a very large function that has a tiny irreducible part nested in it. Would this increase live ranges in the entire function?

Even if it does, maybe other passes are smart enough to not be limited by it? fwiw, after LLVM, in Binaryen this should not be a problem (adding more local.sets at the top of the function has no effect - we already assume all wasm locals have an initial set of 0).

If this is a potential problem in LLVM, then I think the minimal thing to do here is to define all registers that pass through the dispatch block, in the dispatch block.

(Apologies if I've misunderstood the code here...)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D125515/new/

https://reviews.llvm.org/D125515



More information about the llvm-commits mailing list