[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
Thu Jun 22 11:35:34 PDT 2017


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

Address comments by reworking when SafetyInfo->deleteExit and
SafetyInfo->OrderInstruction.invalidateBlock are called.

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 addition, 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.103608.patch
Type: text/x-patch
Size: 22649 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170622/b2abe935/attachment.bin>


More information about the llvm-commits mailing list