[PATCH] D63703: [stack-safety] Refactoring StackSafetyAnalysis to be accsessible from other passes

Gilang Mentari Hamidy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 05:52:12 PDT 2019


gilang added a comment.

In D63703#1561326 <https://reviews.llvm.org/D63703#1561326>, @eugenis wrote:

> If that works for your use case, perhaps a better interface would be a query function that returns offset range or even bool is_safe given an AllocaInst* ?


I initially thought the same as it is more useful and more similar with the pattern used in alias analysis, but since the internals uses SmallVector to store the information, it would be inefficient if the user also need to iterate every AllocaInst* in their own pass, since the querying will takes O(n) complexity. I believe refactoring the SmallVector to, for instance, DenseMap, will require more code changes.

My first thought was to minimize the change to the original code so exposing the iterator to the structure was the faster choice, as the user can also access other information in the struct such as size. However, I will try to implement it as you suggested.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63703/new/

https://reviews.llvm.org/D63703





More information about the llvm-commits mailing list