[PATCH] D66033: [MemorySSA] Rename uses when inserting memory uses.

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 9 15:05:29 PDT 2019


asbirlea created this revision.
asbirlea added a reviewer: george.burgess.iv.
Herald added subscribers: sanjoy.google, Prazek.
Herald added a project: LLVM.

When inserting uses from outside the MemorySSA creation, we don't
normally need to rename uses, based on the assumption that there will be
no inserted Phis (if  Def existed that required a Phi, that Phi already
exists). However, when dealing with unreachable blocks, MemorySSA will
optimize away Phis whose incoming blocks are unreachable, and these Phis end
up being re-added when inserting a Use.
There are two potential solutions here:

1. Analyze the inserted Phis and clean them up if they are unneeded

(current method for cleaning up trivial phis does not cover this)

2. Leave the Phi in place and rename uses, the same way as whe inserting

defs.
This patch use approach 2.

Resolves first test in PR42940.


Repository:
  rL LLVM

https://reviews.llvm.org/D66033

Files:
  include/llvm/Analysis/MemorySSAUpdater.h
  lib/Analysis/MemorySSAUpdater.cpp
  lib/Transforms/Scalar/LICM.cpp
  test/Analysis/MemorySSA/PR42940.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D66033.214459.patch
Type: text/x-patch
Size: 4547 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190809/5105904e/attachment.bin>


More information about the llvm-commits mailing list