[PATCH] D59462: [WebAssembly] Optimize the number of routing blocks in FixIrreducibleCFG

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 16 10:45:02 PDT 2019


aheejin created this revision.
aheejin added reviewers: kripken, sunfish.
Herald added subscribers: llvm-commits, jgravelle-google, sbc100, dschuff.
Herald added a project: LLVM.

Currently we create a routing block to the dispatch block for every
predecessor of every entry. So the total number of routing blocks
created will be (# of preds) * (# of entries). But we don't need to do
this: we need at most 2 routing blocks per loop entry, one for when the
predecessor is inside the loop and one for it is outside the loop. (We
can't merge these into one because this will creates another loop cycle
between blocks inside and blocks outside) This patch fixes this and
creates at most 2 routing blocks per entry.

This also renames variable `Split` to `Routing`, which I think is a bit
clearer.


Repository:
  rL LLVM

https://reviews.llvm.org/D59462

Files:
  lib/Target/WebAssembly/WebAssemblyFixIrreducibleControlFlow.cpp
  test/CodeGen/WebAssembly/irreducible-cfg.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59462.190978.patch
Type: text/x-patch
Size: 5955 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190316/25bc47ca/attachment.bin>


More information about the llvm-commits mailing list