[PATCH] D97583: [WebAssembly] Fix reverse mapping in WasmEHFuncInfo

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 14:47:25 PST 2021


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

D97247 <https://reviews.llvm.org/D97247> added the reverse mapping from unwind destination to their
source, but it had a critical bug; sources can be multiple, because
multiple BBs can have a single BB as their unwind destination.

This changes `WasmEHFuncInfo::getUnwindSrc` to `getUnwindSrcs` and makes
it return a vector rather than a single BB. It does not return the const
reference to the existing vector but creates a new vector because
`WasmEHFuncInfo` stores not `BasicBlock*` or `MachineBasicBlock*` but
`PointerUnion` of them. Also I hoped to unify those methods for
`BasicBlock` and `MachineBasicBlock` into one using templates to reduce
duplication, but failed because various usages require `BasicBlock*` to
be `const` but it's hard to make it `const` for `MachineBasicBlock`
usages.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D97583

Files:
  llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
  llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
  llvm/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp
  llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D97583.326808.patch
Type: text/x-patch
Size: 9401 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210226/4fdbb6c6/attachment-0001.bin>


More information about the llvm-commits mailing list