RSForEachExpand: Improve getelementptr instruction generation.
(1) The old pattern, when accessing fields of the driver info
%base = gep %DriverInfo *%info, 0, <base array index>
%addr = gep [N x i8*]* %base, 0, <index>
This change folds the above into:
%addr = gep %DriverInfo *%info, 0, <base array index>, <index>
which simplifies both way that we generate the GEP instructions as
well as the resulting bitcode.
(2) In addition, GEPs of input pointers and instep sizes can be
hoisted out of the loop body.
(3) Finally, mark all GEPs into the DriverInfo structure as inbounds,
because we know they are.
4 files changed