[PATCH] D108583: [WebAssembly] Use SSAUpdaterBulk in LowerEmscriptenSjLj

Heejin Ahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 23 16:14:27 PDT 2021


aheejin added a subscriber: mzolotukhin.
aheejin added a comment.

@mzolotukhin I'm trying to use `SSAUpdaterBulk` class here, and I'm wondering if this restriction is intended, and if so there is a way to work around that restriction. I'll paste the relevant paragraph in the CL description:

> Not sure
> the author is aware of it, but `SSAUpdaterBulk` seems to have a
> limitation: it cannot handle a use within the same BB as a def but
> before it. For example:
>
>   ... = %a + 1
>   %a = foo();
>
> or
>
>   %a = %a + 1
>
> The uses `%a` in RHS should be rewritten with another SSA variable of
> `%a`, most likely one generated from a `phi`. But `SSAUpdaterBulk`
> thinks all uses of `%a` are below the def of `%a` within the same BB.
> (`SSAUpdater` has two different functions of rewriting because of this:
> RewriteUse <https://github.com/llvm/llvm-project/blob/955b91c19c00ed4c917559a5d66d14c669dde2e3/llvm/include/llvm/Transforms/Utils/SSAUpdater.h#L108-L115> and RewriteUseAfterInsertions <https://github.com/llvm/llvm-project/blob/955b91c19c00ed4c917559a5d66d14c669dde2e3/llvm/include/llvm/Transforms/Utils/SSAUpdater.h#L117-L122>.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D108583



More information about the llvm-commits mailing list