[LLVMdev] [RFC] Module Flags Metadata
Devang Patel
dpatel at apple.com
Mon Jan 30 11:59:28 PST 2012
On Jan 30, 2012, at 11:34 AM, Dan Gohman wrote:
> Even if we single out TBAA, recall that TBAA was one of the main
> motivations for the design of MDNodes -- it's in the second sentance,
> and most of the last paragraph, of
> http://blog.llvm.org/2010/04/extensible-metadata-in-llvm-ir.html
... and in last paragraph the author says ...
"This use of metadata is also safe, because it is an optimization: if the type tag gets dropped, it is always safe to assume that the access aliases everything for TBAA purposes."
(Not this blog entry was written before TBAA was implemented)
>> Regarding, TBAA you say that this optionality is not optional. If you insist that all transformation passes in pipeline _must_ ensure correctness of alias info conveyed by front end as part of TBAA then I guess you need an explicit mechanism anyway. In that case, I'd encourage you to develop a representation that meets needs instead of twisting MDNodes. In other words, I'd not support direction where all transformation passes are _required_ to preserve semantics of any information encoded through MDNodes. That's all.
>
>
> Let's consider whether LLVM's TBAA is really designed wrong.
>
> The only thing you need to know to understand the TBAA issue here
> is that TBAA properties are associated with memory accesses, rather
> than with pointer values, because that's how the TBAA rules in the
> C standard are stated.
>
> I've shown how MDNodes attached to load and store instructions can
> be confounded by otherwise valid optimizations.
What I fail to understand is why can't you use Constant, GlobalVariable, OptDataNode (or TBAANode or something like that) ? Why insist on MDNode ?
> If you really want to claim that it's possible to implement TBAA
> or any metadata-based optimization without making optimizers
> responsible for keeping it up to date, please show me how to do it.
I am not. In fact, are you suggesting that it is not possible to implement TBAA without using MDNode ?
Anyway, I'll stop the thread here from my side.
-
Devang
More information about the llvm-dev
mailing list