[PATCH] D35656: [Polly][Simplify] Remove unused instructions and accesses.

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 19 17:48:51 PDT 2017


Meinersbur created this revision.
Meinersbur added a project: Polly.
Herald added a reviewer: bollu.

Use a mark-and-sweep algorithm to find and remove unused instructions and MemoryAccesses. This is useful in particular to remove scalar writes that are never used anywhere. A scalar write in a loop induces a write-after-write dependency that stops the loop iterations to be rescheduled. Such writes can be a result of previous transformations such as DeLICM and operand tree forwarding.

It adds a new class VirtualInstruction that represents an instruction in a particular statement. At the moment an instruction can only belong to the statement that represents a BasicBlock. In the future, instructions can be in one of multiple statements representing a BasicBlock (Nandini's work), in different statements than its BasicBlock would indicate, and even multiple statements at once (by forwarding operand trees). It also integrates nicely with the VirtualUse class.

ScopStmt::contains(Instruction*) currently uses the instruction's parent BasicBlock to check whether it contains the instruction. It will need to check the actual statement list when one of the aforementioned features become possible.


https://reviews.llvm.org/D35656

Files:
  include/polly/ScopInfo.h
  include/polly/Support/VirtualInstruction.h
  lib/Support/VirtualInstruction.cpp
  lib/Transform/Simplify.cpp
  test/Simplify/dead_access_load.ll
  test/Simplify/dead_access_phi.ll
  test/Simplify/dead_access_value.ll
  test/Simplify/dead_instruction.ll
  test/Simplify/gemm.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35656.107425.patch
Type: text/x-patch
Size: 29533 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170720/8540bf39/attachment.bin>


More information about the llvm-commits mailing list