[PATCH] D41104: Set the NoRecurse attribute for the dbg intrinsics.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 12 16:50:37 PST 2017


efriedma added subscribers: mehdi_amini, jmolloy, manmanren, efriedma.
efriedma added a comment.

> However, I do wonder, is the attribute propagation semantically correct?

As you note, it's wrong for functions outside the current module... but it mostly works out at the moment because we don't mark function declarations norecurse. :)  (See https://reviews.llvm.org/D14228 for original discussion.)

> the norecurse logic is built on caller-callee relationship and ignores the dataflow.

This isn't what LangRef says, and it would be kind of hard to nail down a definition which actually works like this.  I mean, I guess you could try to define it in terms of the callgraph, but that would have unusual implications. (What happens if your program contains a call which is dynamically dead, and incorrectly marked norecurse?)

We probably want a new attribute to express the relevant property, which is essentially that most intrinsics don't call any function defined in your program.


https://reviews.llvm.org/D41104





More information about the llvm-commits mailing list