On 1/18/2013 11:34 AM, Hal Finkel wrote:> > I agree. FWIW, I'm currently working on making the LLVM-based Fortran compiler non-hypothetical, and so for several reasons, I'd like to have a solution to this. If we can't think of anything better, we could always fall back to the N^2 metadata solution (explicit mark as no-alias all pairs that don't alias), but I'd rather we come up with something else.How about having Fortran-specific metadata, and a Fortran-specific alias analysis? The metadata could indicate how the properties of the Fortran-frontend-generated types relate to the types that the IR code uses to load/store data. For example: f90_array_type = type { i32 size, double* data }; metadata = "attributes of f90_array_type, like restrict, should be applied to the member pointer 'data'" Is this something you've considered? -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
On Fri, Jan 18, 2013 at 10:00 AM, Krzysztof Parzyszek < kparzysz at codeaurora.org> wrote:> f90_array_type = type { i32 size, double* data };I am not certain how fortran implements multi-dimensional arrays, but in my case I'm doing something like type { i32 nd, i32* dims, double* data }; Perhaps we could add !tbaa.pointer? !1 = metadata !{ metadata !"int", metadata !0 } !2 = metadata !{ metadata !"double", metadata !0 } !3 = metadata !{ metadata !1, 0 } ; tbaa.pointer { metadata type, i64 noalias } !4 = metadata !{ metadata !2, 1 } !5 = { i64 0, i64 4, metadata !1, i64 8, i64 8, metadata !3, i64 16, i64 8, metadata !4 } %Array = type { i32 nd, i32* dims, double* data }, !tbaa.struct !5 Dimitri. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130118/1ffed89d/attachment.html>
Actually, I just realized the referenced pointer metadata isn't marked as such in any way when its referenced in tbaa.struct. I suppose it also doesn't have much to do with TBAA as well, so that's also a misnomer. My metadata-fu is still weak. Dimitri. On Fri, Jan 18, 2013 at 10:24 AM, Dimitri Tcaciuc <dtcaciuc at gmail.com>wrote:> > On Fri, Jan 18, 2013 at 10:00 AM, Krzysztof Parzyszek < > kparzysz at codeaurora.org> wrote: > >> f90_array_type = type { i32 size, double* data }; > > > I am not certain how fortran implements multi-dimensional arrays, but in > my case I'm doing something like > > type { i32 nd, i32* dims, double* data }; > > Perhaps we could add !tbaa.pointer? > > !1 = metadata !{ metadata !"int", metadata !0 } > !2 = metadata !{ metadata !"double", metadata !0 } > > !3 = metadata !{ metadata !1, 0 } ; tbaa.pointer { metadata type, > i64 noalias } > !4 = metadata !{ metadata !2, 1 } > > !5 = { i64 0, i64 4, metadata !1, i64 8, i64 8, metadata !3, i64 16, > i64 8, metadata !4 } > > %Array = type { i32 nd, i32* dims, double* data }, !tbaa.struct !5 > > > Dimitri. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130118/b63a358f/attachment.html>