ترغب بنشر مسار تعليمي؟ اضغط هنا

Practical Inlining of Functions with Free Variables

61   0   0.0 ( 0 )
 نشر من قبل Lars Bergstrom
 تاريخ النشر 2013
  مجال البحث الهندسة المعلوماتية
والبحث باللغة English




اسأل ChatGPT حول البحث

A long-standing practical challenge in the optimization of higher-order languages is inlining functions with free variables. Inlining code statically at a function call site is safe if the compiler can guarantee that the free variables have the same bindings at the inlining point as they do at the point where the function is bound as a closure (code and free variables). There have been many attempts to create a heuristic to check this correctness condition, from Shivers kCFA-based reflow analysis to Mights Delta-CFA and anodization, but all of those have performance unsuitable for practical compiler implementations. In practice, modern language implementations rely on a series of tricks to capture some common cases (e.g., closures whose free variables are only top-level identifiers such as +) and rely on hand-inlining by the programmer for anything more complicated. This work provides the first practical, general approach for inlining functions with free variables. We also provide a proof of correctness, an evaluation of both the execution time and performance impact of this optimization, and some tips and tricks for implementing an efficient and precise control-flow analysis.


قيم البحث

اقرأ أيضاً

Paisley is an extensible lightweight embedded domain-specific language for nondeterministic pattern matching in Java. Using simple APIs and programming idioms, it brings the power of functional-logic processing of arbitrary data objects to the Java p latform, without constraining the underlying object-oriented semantics. Here we present an extension to the Paisley framework that adds pattern-based control flow. It exploits recent additions to the Java language, namely functional interfaces and lambda expressions, for an explicit and transparent continuation-passing style approach to control. We evaluate the practical impact of the novel features on a real-world case study that reengineers a third-party open-source project to use Paisley in place of conventional object-oriented data query idioms. We find the approach viable for incremental refactoring of legacy code, with significant qualitative improvements regarding separation of concerns, clarity and intentionality, thus making for easier code understanding, testing and debugging.
We address the following question: what can one say, for a tuple $(Y_1,dots,Y_d)$ of normal operators in a tracial operator algebra setting with prescribed sizes of the eigenspaces for each $Y_i$, about the sizes of the eigenspaces for any non-commut ative polynomial $P(Y_1,dots,Y_d)$ in those operators? We show that for each polynomial $P$ there are unavoidable eigenspaces, which occur in $P(Y_1,dots,Y_d)$ for any $(Y_1,dots,Y_d)$ with the prescribed eigenspaces for the marginals. We will describe this minimal situation both in algebraic terms - where it is given by realizations via matrices over the free skew field and via rank calculations - and in analytic terms - where it is given by freely independent random variables with prescribed atoms in their distributions. The fact that the latter situation corresponds to this minimal situation allows to draw many new conclusions about atoms in polynomials of free variables. In particular, we give a complete description of atoms in the free commutator and the free anti-commutator. Furthermore, our results do not only apply to polynomials, but much more general also to non-commutative rational functions.
We formulate a free probabilistic analog of the Wasserstein manifold on $mathbb{R}^d$ (the formal Riemannian manifold of smooth probability densities on $mathbb{R}^d$), and we use it to study smooth non-commutative transport of measure. The points of the free Wasserstein manifold $mathscr{W}(mathbb{R}^{*d})$ are smooth tracial non-commutative functions $V$ with quadratic growth at $infty$, which correspond to minus the log-density in the classical setting. The space of smooth tracial non-commutative functions used here is a new one whose definition and basic properties we develop in the paper; they are scalar-valued functions of self-adjoint $d$-tuples from arbitrary tracial von Neumann algebras that can be approximated by trace polynomials. The space of non-commutative diffeomorphisms $mathscr{D}(mathbb{R}^{*d})$ acts on $mathscr{W}(mathbb{R}^{*d})$ by transport, and the basic relationship between tangent vectors for $mathscr{D}(mathbb{R}^{*d})$ and tangent vectors for $mathscr{W}(mathbb{R}^{*d})$ is described using the Laplacian $L_V$ associated to $V$ and its pseudo-inverse $Psi_V$ (when defined). Following similar arguments to arXiv:1204.2182, arXiv:1701.00132, and arXiv:1906.10051 in the new setting, we give a rigorous proof for the existence of smooth transport along any path $t mapsto V_t$ when $V$ is sufficiently close $(1/2) sum_j operatorname{tr}(x_j^2)$, as well as smooth triangular transport.
As is well known, the common elementary functions defined over the real numbers can be generalized to act not only over the complex number field but also over the skew (non-commuting) field of the quaternions. In this paper, we detail a number of ele mentary functions extended to act over the skew field of Clifford multivectors, in both two and three dimensions. Complex numbers, quaternions and Cartesian vectors can be described by the various components within a Clifford multivector and from our results we are able to demonstrate new inter-relationships between these algebraic systems. One key relationship that we discover is that a complex number raised to a vector power produces a quaternion thus combining these systems within a single equation. We also find a single formula that produces the square root, amplitude and inverse of a multivector over one, two and three dimensions. Finally, comparing the functions over different dimension we observe that $ Cell left (Re^3 right) $ provides a particularly versatile algebraic framework.
The use of annotations, referred to as assertions or contracts, to describe program properties for which run-time tests are to be generated, has become frequent in dynamic programing languages. However, the frameworks proposed to support such run-tim e testing generally incur high time and/or space overheads over standard program execution. We present an approach for reducing this overhead that is based on the use of memoization to cache intermediate results of check evaluation, avoiding repeated checking of previously verified properties. Compared to approaches that reduce checking frequency, our proposal has the advantage of being exhaustive (i.e., all tests are checked at all points) while still being much more efficient than standard run-time checking. Compared to the limited previous work on memoization, it performs the task without requiring modifications to data structure representation or checking code. While the approach is general and system-independent, we present it for concreteness in the context of the Ciao run-time checking framework, which allows us to provide an operational semantics with checks and caching. We also report on a prototype implementation and provide some experimental results that support that using a relatively small cache leads to significant decreases in run-time checking overhead.
التعليقات
جاري جلب التعليقات جاري جلب التعليقات
سجل دخول لتتمكن من متابعة معايير البحث التي قمت باختيارها
mircosoft-partner

هل ترغب بارسال اشعارات عن اخر التحديثات في شمرا-اكاديميا