------- Comment #127 from ian at airs dot com 2007-05-23 15:23 ------- Re comment #105.
The case where TBAA is most useful is on a deeply pipelined in-order processor with multiple function units and a high latency memory cache. One example I've worked on is an embedded VLIW processor with vector instructions. TBAA is of relatively little interest on an out-of-order processor. It's interesting to talk about PTA when you see the actual objects and you see how the pointers are taken. But in practice many real functions simply take pointers to arrays in memory. PTA can say nothing useful about those pointers, since they could point to anything. TBAA can say a lot. Losing the ability to sinks loads across stores and vice-versa means putting additional constraints on the scheduler which makes it harder to exploit the multiple function units. Conversely, it constrains the register allocator by tending to extend register lifetimes. Also, in your list of cases, you missed x = *int; *double = 1.0; x = *int; With TBAA we can eliminate the second load as a duplicate. With your proposed aliasing change we can not. I don't understand why you argue in comment #124 that our current scheme will esverely penalize placement new. On mainline there is no penalty for placement new. So you must be referring to one of the patches. But I don't think we've agreed on any of them at the moment. And I think we see the outlines of a successful patch: make placement new return a pointer which effectively aliases everything. That will permit us to reorder loads and eliminate dead stores. It won't permit us to arbitrarily re-order loads and stores, but I'm skeptical that that will count as a severe penalty. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29286