[PATCH] D10920: Unify isSafeToLoadUnconditionally and isDereferenceablePointer

Artur Pilipenko apilipenko at azulsystems.com
Fri Jul 3 03:41:23 PDT 2015


apilipenko created this revision.
apilipenko added a reviewer: hfinkel.
apilipenko added a subscriber: llvm-commits.

There are several optimizations when we try to load speculatively. There are also two similar functions to determine whether it's a safe transformation:
* isSafeToLoadUnconditionally
* isDereferenceableAndAlignedPointer

Once we have D9791in place, we can unify these two functions. With this change isSafeToLoadUnconditionally calls isDereferenceableAndAlignedPointer to check whether speculative execution is possible.

As a side effect optimizations which use isSafeToLoadUnconditionally will benefit from dereferenceable attribute. Corresponding test cases added. 

http://reviews.llvm.org/D10920

Files:
  include/llvm/Analysis/Loads.h
  lib/Analysis/Loads.cpp
  lib/Analysis/ValueTracking.cpp
  lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp
  lib/Transforms/Scalar/SROA.cpp
  lib/Transforms/Scalar/ScalarReplAggregates.cpp
  lib/Transforms/Scalar/TailRecursionElimination.cpp
  test/Transforms/InstCombine/select.ll
  test/Transforms/TailCallElim/reorder_load.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D10920.29006.patch
Type: text/x-patch
Size: 13272 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150703/4aa170be/attachment.bin>


More information about the llvm-commits mailing list