================

----------------
apaznikov wrote:

Thank you for the suggestion. We looked at StackSafetyAnalysis.

The two analyses answer different questions and rely on different mechanisms:
* **StackSafetyAnalysis** proves spatial safety — all accesses to an alloca 
stay in-bounds.
* **EscapeAnalysis** proves thread locality — a pointer to an allocation cannot 
be observed by another thread.

These properties are orthogonal: an object can be stack-safe yet have its 
address stored into a global (causing a race), or be thread-local yet have 
out-of-bounds accesses. Merging the two would complicate both, since they have 
no shared algorithmic core. 

Two additional practical differences: EscapeAnalysis handles heap allocations 
in addition to stack ones, and it works intraprocedurally without requiring 
ModuleSummaryIndex or ThinLTO. That said, in the future EscapeAnalysis could 
potentially reuse StackSafetyAnalysis's interprocedural summary infrastructure 
to extend its reach across call boundaries

https://github.com/llvm/llvm-project/pull/169896
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to