[Mar 22nd Discussion] Type-Based Alias Analysis #301
Replies: 13 comments 12 replies
-
This was one of those papers where after you read the abstract the idea seems extremely simple but it would be very hard to think of it by yourself! It seems so obvious in hindsight that one could leverage types to perform alias analysis. Also loved when I encountered this sentence "A few researchers recently evaluated alias analyses by measuring the execution-time improvement due to an optimization that uses alias analysis". It's wild to think that that wasn't the first thing someone would think to do when evaluating a technique like this. |
Beta Was this translation helpful? Give feedback.
-
Spinning off the second part of @5hubh4m's comment, I think an important (and perhaps undersold) contribution of this paper is towards the rigorous analysis of aliasing in particular and compilers in general. It's interesting that they don't state correctness as a goal; this is probably just implied. In any case, I think this is a good worked example of how an optimization needs to be analyzed from different angles. I enjoy in particular that the number of opportunities for RLA that were generated is discussed. Even if the current pass isn't able to take full advantage of this, maybe future passes will. |
Beta Was this translation helpful? Give feedback.
-
Some thoughts I had reading this paper: I wonder how much (and to what extent) compilers for untyped languages suffer from optimization because the lack of information. Another +1 for typed languages! What happens in languages that support arbitrary casting. Sometimes we exploit something we know about the system in a way that lets us use one type as another even if this is wrong. How might the ideas in this paper apply to those type of languages? How effective are these methods under this new conservatism? The paper only said the first algorithm must be more conservative -- do the 2nd and 3rd algos work with the same added conservatism? |
Beta Was this translation helpful? Give feedback.
-
One part of this paper that I found interesting was its discussion of limit analysis. After reading this paper, it seems so obvious that it useful to determine how many missed optimization opportunities there were in order to evaluate an alias analysis, but I would have never thought of this idea myself! I wonder if there has been any alias analysis research after 1998 that uses this technique? |
Beta Was this translation helpful? Give feedback.
-
I thought it was interesting how the paper evaluates the effectiveness of Type Based Alias Analysis by showing the number of times the redundant load elimination pass utilizes information from the alias analysis pass to eliminate instructions. It seems like a strong method to characterize exactly the impact of the alias analysis pass. I also wondered if the authors considered other possible passes that use alias analysis as well, such as something like dead store elimination, and tried to understand how much their alias analysis pass benefits dead store elimination. I was also curious how much better more sophisticated"alias analyses do in comparison to the type based alias analysis, particularly in how these more sophisticated passes do when compared in the upper bound evaluations across the benchmarks in the paper. I assume other alias analysis passes are not going to do much better, because of how well type based alias analysis performs relative to the upper bound. |
Beta Was this translation helpful? Give feedback.
-
I think the paper was really cool. The simplicity of TBAA is really neat, and this paper probably has the most in-depth performance based evaluation section I've seen so far. Limit evaluations Modern compilers like GCC and LLVM seem to also use TBAA, but I was wondering if potentially doing something with |
Beta Was this translation helpful? Give feedback.
-
The idea of type-based alias analysis looks really neat, and I also find the results of the experimental evaluation insightful. Some thoughts regarding the type-safe languages that are suitable for this kind of analyses. There are languages that could not be explicitly considered as type-safe, but they still are. Such an example is Scala. For example, in Scala a variable assignment can be defined either as |
Beta Was this translation helpful? Give feedback.
-
Echoing the general sentiment in this thread, this was a fun paper to read! The analysis are so simple and seem rather obvious (especially in hindsight), but it is far less obvious that such a simple analysis could produce substantial results, and the techniques for analysis TBAA presented in this paper seem crucial to understanding the true power of such analysis. It also provides an interesting window into the sort of compilers research being conducted in 1998, as well as how it was being conducted. One thing that I wonder about is if TBAA would perform similarly on other type-safe languages like Java. Java complicates this type-based alias analysis since an expression like |
Beta Was this translation helpful? Give feedback.
-
I also find this paper very easy to understand. The three proposed analyses TypeDecl, FieldTypeDecl, and SMFieldTypeRefs, are all straightforward and intuitive to design and implement. Types do provide lots of information for compilers to do optimization. Since the authors evaluate the open and closed world assumptions in Fig.12 and show there are no significant differences between the two assumptions, I wonder what the performance will be if using TBAA for C++. Though C/C++ may have arbitrary type casting with pointers, those casting can still be tracked, and the result of each operation should have a concrete type. In that way, maybe TBAA can still be extended to unsafe languages? Another question is also about the reusability: are there any commercial compilers nowadays using alias analysis or TBAA, and whether the analysis speed is still the problem? Have the limitations stated in the introduction part been solved? |
Beta Was this translation helpful? Give feedback.
-
The paper is cool! I have a kind of basic question here: can type-based alias analysis be applied together with dataflow-based alias analysis we talked on the class? I think it should be able to do that, but maybe it's not worthy because of the inefficiency? |
Beta Was this translation helpful? Give feedback.
-
Something that I personally found really interesting in this paper is that the run-time improving of incorporating Type-Based Alias Analysis didn't change much between the original TypeDecl analysis and the more precise FieldTypeDecl and SMFieldTypeRefs. It really shows the importance of simple-sounding ideas and a strong evaluation; in my opinion I'd think that "the more precise, the better", but here it shows that higher precision does not necessarily imply better run-time improvement using optimizations. That being said, there are only 10 benchmark programs, so we also don't know how much this holds for a larger set of benchmarks. It would also be interesting to see how these ideas and findings hold up ~24 years later. |
Beta Was this translation helpful? Give feedback.
-
I really like this paper since the idea is simple and neat! I also resonate with @5hubh4m that it's surprising no one had ever used type-based approach on this problem before. One interesting thing I found that SMFieldTypeRefs does not provide any noticeable improvement over FieldTypeDecl. I think the insight could be that analyzing assignments does not really provide much benefit than people thought. It appears to be an evidence against some traditional assignment-based methods on memory aliasing. On the other hand, I feel like being in different fields is a good prior knowledge that highly suggests disjointness. This is helpful for any aggressive memory aliasing solutions. I also find the introduction of some terminology and evaluation mechanism in this paper to be very valuable. For example, Access Path (AP), Limit and Dynamic analysis. |
Beta Was this translation helpful? Give feedback.
-
I also think it's cool that this paper has rigorous evaluations on both the static and dynamic effects of TBAA and also the upper bound. At first, I was curious how to get the "ground truth" of pointer aliasing and later realized that of course, we can just run the program and instrument every load to record its address and value. I think it's a useful way to get an upper bound of an optimization algorithm by profiling it first. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a discussion thread for Type-based alias analysis by Amer Diwan, Kathryn S. McKinley, and J. Eliot B. Moss. Discussion leads: Andrey Yao and Andrew Butt
Beta Was this translation helpful? Give feedback.
All reactions