[PATCH] D60047: [CaptureTracking] Pointer comparisons cannot escape
Ayke via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 31 07:20:14 PDT 2019
aykevl added a comment.
Some more background:
I'm developing a compiler in which I use lots of compiler-inserted null checks. It also does escape analysis, which relies on the nocapture flag for cheap interprocedural analysis.
The main target of this compiler is microcontrollers which don't have a MMU (or even MPU) and therefore don't trap on a read from address 0. This means that it is necessary to explicitly compare against null (fault maps cannot be used). It also uses escape analysis to avoid heap allocation, which is critical for performance. However, I found that since inserting these null checks, escape analysis suffers badly.
I could implement interprocedural escape analysis or do a manual pass that inserts nocapture (basically copying CaptureTracking), but I would like to rely on the functionattrs pass for this if at all possible.
I wrote a partial fix here, but it is not complete as it does not work across functions.
https://github.com/tinygo-org/tinygo/pull/250
Repository:
rL LLVM
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D60047/new/
https://reviews.llvm.org/D60047
More information about the llvm-commits
mailing list