HomePhabricator

IR: Introduce inrange attribute on getelementptr indices.

Description

IR: Introduce inrange attribute on getelementptr indices.

If the inrange keyword is present before any index, loading from or
storing to any pointer derived from the getelementptr has undefined
behavior if the load or store would access memory outside of the bounds of
the element selected by the index marked as inrange.

This can be used, e.g. for alias analysis or to split globals at element
boundaries where beneficial.

As previously proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-July/102472.html

Differential Revision: https://reviews.llvm.org/D22793

Details

Committed
pccNov 10 2016, 2:34 PM
Differential Revision
D22793: IR: Introduce inbounds attribute on getelementptr indices.
Parents
rL286513: [X86] Updated knownbits vector ADD/SUB test
Branches
Unknown
Tags
Unknown