[PATCH] D85393: [WIP] [IR] Adding noprogress as a LLVM IR attribute

Ralf via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 09:06:42 PDT 2020


RalfJung added a comment.

> Either should do the trick after a while given that all optimizations need to preserve/handle attribute already, you cannot just drop them and so noprogress should be sufficient.

Ah, I thought so far attributes were always safe to drop. If that is not the case, what remains is the possible confusion on our side when having to talk about "noprogress" and no-"noprogress" functions, and the asymmetry with most (but seemingly not all) existing attributes.

> Hm... I will need to think about this. Given that we want to mix C/C++ with Rust on IR-level, right?

That would be an example, yes -- cross-language LTO is used e.g. by Firefox. From the normative perspective, neither the C++ spec nor the Rust spec say what happens when a C++ and Rust function form a mutually infinite recursion. My personal preference is to allow such behavior, i.e., infinite recursion is only UB if *all* involved functions are no-"noprogress". But that is mostly my personal bias against making things UB, I cannot say how this affects analyses/optimizations.

(I am assuming here that stack overflows are already handled e.g. by a guard page, which means that in pure Rust code, infinite recursion is well-defined, and this must be handled appropriately by optimizations.)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85393



More information about the llvm-commits mailing list