[PATCH] D74853: [RFC WIP] Fix DSE for asm outputs (aka PR44913)

Alexander Potapenko via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 19 10:49:00 PST 2020


glider created this revision.
glider added reviewers: fhahn, efriedma.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.
glider added a subscriber: dvyukov.
glider added a comment.

Hi Florian, Eli et al.,

I tried attacking https://bugs.llvm.org/show_bug.cgi?id=44913, and the provided patch seems to fix the problem.
Can you please take a look and tell if the general idea makes sense?
If it does, I can polish it by replacing all uses of getLocForWrite() with getLocsForWrite() (we may also need a similar function for reads) and move the code around a bit.


We need to collect the outputs of inline assembly statements, which in
the same time do not serve as inputs (i.e. those declared as "=m", not
"+m"). Doing so requires changing the DSE code so that every instruction
can potentially have multiple outputs.
Right now it seems sufficient to just change eliminateDeadStores() to
handle that case, but probably other places also need to be changed.
It also makes sense to factor out the "for (auto Loc: Locs)" loop from
that function to make it more readable.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D74853

Files:
  llvm/lib/Transforms/Scalar/DeadStoreElimination.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74853.245462.patch
Type: text/x-patch
Size: 23593 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200219/85a604f4/attachment.bin>


More information about the llvm-commits mailing list