[PATCH] D68218: [WebAssembly] Unstackify regs after fixing unwinding mismatches

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 30 06:41:39 PDT 2019


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

Fixing unwind mismatches for exception handling can result in splicing
existing BBs and moving some of instructions to new BBs. In this case
some of stackified def registers in the original BB can be used in the
split BB. For example, we have this BB and suppose %r0 is a stackified
register.

  bb.1:
    %r0 = call @foo
    ... use %r0 ...

After fixing unwind mismatches in CFGStackify, `bb.1` can be split and
some instructions can be moved to a newly created BB:

  bb.1:
    %r0 = call @foo
  
  bb.split (new):
    ... use %r0 ...

In this case we should make %r0 un-stackified, because its use is now in
another BB.

When spliting a BB, this CL unstackifies all def registers that have
uses in the new split BB.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D68218

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyMachineFunctionInfo.h
  llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D68218.222411.patch
Type: text/x-patch
Size: 4180 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190930/f5c08c93/attachment.bin>


More information about the llvm-commits mailing list