[PATCH] D21167: [LICM] Make isGuaranteedToExecute more accurate.

Eli Friedman via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 8 19:31:42 PDT 2016


eli.friedman created this revision.
eli.friedman added reviewers: sanjoy, hfinkel, reames, chandlerc.
eli.friedman added a subscriber: llvm-commits.

Make isGuaranteedToExecute use the
isGuaranteedToTransferExecutionToSuccessor helper, and make that helper
a bit more accurate.

There's a potential performance impact here from assuming that arbitrary
calls might not return. This probably has little impact on loads and
stores to a pointer because most things alias analysis can reason about
are dereferenceable anyway. The other impacts, like less aggressive
hoisting of sdiv by a variable and less aggressive hoisting around
volatile memory operations, are unlikely to matter for real code.

This also impacts SCEV, which uses the same helper.  It's a minor
improvement there because we can tell that, for example, memcpy always
returns normally. Strictly speaking, it's also introducing
a bug, but it's not any worse than everywhere else we assume readonly
functions terminate.

Fixes http://llvm.org/PR27857.

http://reviews.llvm.org/D21167

Files:
  lib/Analysis/ValueTracking.cpp
  lib/IR/Instruction.cpp
  lib/Transforms/Scalar/LICM.cpp
  test/Transforms/LICM/hoist-nounwind.ll
  test/Transforms/LICM/hoisting.ll
  test/Transforms/LICM/preheader-safe.ll
  test/Transforms/LICM/promote-tls.ll
  test/Transforms/LICM/scalar_promote.ll
  test/Transforms/LICM/volatile-alias.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21167.60131.patch
Type: text/x-patch
Size: 9778 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160609/73489f83/attachment.bin>


More information about the llvm-commits mailing list