[PATCH] D32720: [LICM] Introduce a finer granularity option to compute early exits.

Xin Tong via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 23 18:29:36 PDT 2017


trentxintong updated this revision to Diff 103818.
trentxintong added a comment.

Hmm ... last version did not compile. This should be good now.

To reiterate:

The general rule to update OrderedInstruction and EarlyExits in SafetyInfo is as
follow: Before we delete an instruction in the loop, we invalidate the OrderedInstruction
for the block it is in, as OrderedInstruction may still hold pointer to the instruction.

In case we move an instruction, i.e. hoisting, we invalidate the block it is moved to as well.

Additionally, we check whether it is an early exit. If it is, we remove it from the
early exit list.

We can delete instructions in the loop for various reasons in LICM including : instruction
is simplified and removed, instruction is sunk out of the loop and instruction is
hoisted out of the loop.


https://reviews.llvm.org/D32720

Files:
  include/llvm/Transforms/Utils/LoopUtils.h
  include/llvm/Transforms/Utils/OrderedInstructions.h
  lib/Transforms/Scalar/LICM.cpp
  lib/Transforms/Scalar/LoopIdiomRecognize.cpp
  lib/Transforms/Scalar/LoopUnswitch.cpp
  lib/Transforms/Utils/LoopUtils.cpp
  lib/Transforms/Utils/OrderedInstructions.cpp
  test/Transforms/LICM/loop-early-exits.ll
  test/Transforms/LICM/preheader-safe.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D32720.103818.patch
Type: text/x-patch
Size: 23085 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170624/9db40c58/attachment.bin>


More information about the llvm-commits mailing list