[llvm-dev] RFC: inbounds on getelementptr indices for global splitting

Tobias Grosser via llvm-dev llvm-dev at lists.llvm.org
Tue Jul 19 22:55:48 PDT 2016

On Tue, Jul 19, 2016, at 03:02 AM, Peter Collingbourne via llvm-dev
> Hi all,
> I'd like to propose an IR extension that allows the inbounds keyword to
> be
> attached to indices in a getelementptr constantexpr.

Hi Peter,

this proposal (in its updated version with load/stores triggering the
undef) is a good idea. It will also help to propagate out-of-bounds
information from C to LLVM-IR, which we are currently lacking at IR
level. As a result, multi-dimensional data-dependence analysis must
either take possible out-of-bounds accesses into consideration or emit
run-time checks to be correct. In Polly we have already been considering
to pass the information provided by your inbounds keywords  using
llvm.assume [1], to avoid this additional complexity. However,  as this
is littering the IR with assumptions, the relevant patch  was never
proposed for integration. Your approach is well targeted and  due to the
additional use cases you mention especially appealing. 


[1] https://llvm.org/bugs/show_bug.cgi?id=27067

More information about the llvm-dev mailing list