llvm/test/Transforms/InstSimplify
Peter Collingbourne 74eabdd998 Introduce llvm.load.relative intrinsic.
This intrinsic takes two arguments, ``%ptr`` and ``%offset``. It loads
a 32-bit value from the address ``%ptr + %offset``, adds ``%ptr`` to that
value and returns it. The constant folder specifically recognizes the form of
this intrinsic and the constant initializers it may load from; if a loaded
constant initializer is known to have the form ``i32 trunc(x - %ptr)``,
the intrinsic call is folded to ``x``.

LLVM provides that the calculation of such a constant initializer will
not overflow at link time under the medium code model if ``x`` is an
``unnamed_addr`` function. However, it does not provide this guarantee for
a constant initializer folded into a function body. This intrinsic can be
used to avoid the possibility of overflows when loading from such a constant.

Differential Revision: http://reviews.llvm.org/D18367

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-22 21:18:02 +00:00
..
2010-12-20-Boolean.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
2011-01-14-Thread.ll
2011-02-01-Vector.ll
2011-09-05-InsertExtractValue.ll
2011-10-27-BinOpCrash.ll
2011-11-23-MaskedBitsCrash.ll
2013-04-19-ConstantFoldingCrash.ll
add-mask.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
AndOrXor.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
apint-or.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
assume.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
bswap.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
call-callconv.ll
call.ll
compare.ll Add optimization for 'icmp slt (or A, B), A' and some related idioms based on knowledge of the sign bit for A and B. 2016-04-21 00:53:14 +00:00
dead-code-removal.ll
exact-nsw-nuw.ll
fast-math.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
fdiv.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
floating-point-arithmetic.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
floating-point-compare.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
fold-builtin-fma.ll
gep.ll
implies.ll [ValueTracking] Correct lit test comments. NFC. 2016-04-18 19:11:45 +00:00
load-relative-32.ll Introduce llvm.load.relative intrinsic. 2016-04-22 21:18:02 +00:00
load-relative.ll Introduce llvm.load.relative intrinsic. 2016-04-22 21:18:02 +00:00
load.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
maxmin.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
noalias-ptr.ll
past-the-end.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
phi.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
ptr_diff.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
reassociate.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
rem.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
select.ll
shift-128-kb.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
shr-nop.ll
undef.ll [InstSimplify] regenerate checks using a script 2016-03-25 20:12:25 +00:00
vector_gep.ll
vector_ptr_bitcast.ll