{'fraction_non_alphanumeric': 0.028682125715607472, 'fraction_numerical': 0.00566703290348696, 'mean_word_length': 4.926662097326936, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Probabilistic Alias Analysis for Parallel Programming in SSA Forms

Static alias analysis of different type of programming languages has been drawing researcher attention. However most of the results of existing techniques for alias analysis are not precise enough compared to needs of modern compilers. Probabilistic versions of these results, in which result elements are associated with occurrence probabilities, are required in optimizations techniques of modern compilers. This paper presents a new probabilistic approach for alias analysis of parallel programs. The treated parallelism model is that of SPMD where in SPMD, a program is executed using a fixed number of program threads running on distributed machines on different data. The analyzed programs are assumed to be in the static single assignment (SSA) form which is a program representation form facilitating program analysis. The proposed technique has the form of simply-strictured system of inference rules. This enables using the system in applications like Proof-Carrying Code (PPC) which is a general technique for proving the safety characteristics of modern programs.


Introduction
Considerable efforts of research have been devoted to achieve the static alias analysis of different type of programming languages. Algorithms for calculating alias relationships for all program points exist for basic programming techniques. Classically, alias relationships fall in two groups: definitely-alias relationships and possibly-alias relationships. The former is typically true for all possible execution paths and the later might typically be true for some of the possible execution paths. However the information calculated by most existing algorithms for alias analysis is not precise enough compared to the needs of modern compilers. This is so as modern compilers need finer alias-information to be able to achieve tasks like code specialization and data speculation. In other words information calculated by most alias analysis techniques do not help compilers to do aggressive optimizations. More specifically, possibly-alias relationships is not rich enough to inform the comfier about the possibility that constraints for the executions. Hence compilers are somehow forced to follow a conservative way and assume the conditions validity for all execution paths [1], [2], [3].
A dominant programming technique of parallelism for large-scale machines equipped with distributed-memories is the single program, multiple data (SPMD) model. In SPMD, a program is executed using a fixed number of program threads running on distributed machines on different data [4]. SPMD can be executed on low-overhead and simple dynamic systems and is convenient for expressing parallelism concepts. This parallelism model is used by message-sending architectures such as MPI. SPMD is also adapted by languages whose address spaces are globally partitioned (PGAS) such as UPC, Co-Array Fortran, and Titanium. Specific deadlocks can be prevented using the SPDM model which can also be used to achieve probabilistic data races and specific program optimizations [5], [6].
Static single assignment (SSA) [7], [8] is a program representation form facilitating program analysis. SSA forms are important for software re-engineering and compiler construction. Program analysis needs data-flow information about points of the program being analyzed. Such information is necessary for program compilation and re-engineering and is conveniently collected by SSA. For program variables, some analyses need to know assignment statements that could have assigned the used variable content. In Static single assignment (SSA) form exactly one variable definition corresponds to a variable use. This is only possible if the algorithm building the SSA form is allowed to insert auxiliary definitions if it is possible for different definitions to get into a specific program point.
A general technique for proving the safety characteristics of modern programs is Proof-Carrying Code (PCC) [9], [10]. PCC proofs are needed and typically constructed using logics annotated with inference rules that are languagespecific. The proofs ensures safety in case there are no bugs in the inference rules. One type of Proof-Carrying Code is Foundational Proof-Carrying Code (FPCC) which uses theories of mathematical logic. The small trusted base of FPCCs and the fact that they are not tied to any specific systems make them more secure and robust. This paper presents a new technique for probabilistic alias analysis of parallel programs. The technique has the form of simply-strictured system of inference rules. The information calculated by the proposed technique are precise enough compared to information needed by modern compilers for compilations, re-engineering, aggressive-optimization processes. The proposed technique is designed to work on the common and robust data-flow representation; SSA forms of parallel programs. The use of inference systems in the proposed technique makes it straightforward for our technique to produce justifications needed by Foundational Proof-Carrying Code (FPCCs). The proofs have the form of inference rules derivations that are efficiently transferable. The parallelism model treated in this paper is that of single program, multiple data (SPMD) in which the same program is executed on different machines on different sets of data.

Motivation
The paper is motivated by need for a precise probabilistic alias analysis for SPMD programs running on a hierarchy of distributed machines. The required technique is supposed to associate each analysis result with a correctness proof (in the form of type derivations) to be used in proof-carrying code applications.

Contributions
The contribution of the paper is a new approach for probabilistic alias analysis of SPMD programs running on SSA forms of programs and producing justifications with analysis results.

Paper Outline
The outline of this paper is as follows. Section 2 presents the langauge model, SSA-DisLang, of the paper. This section also presents an informal semantics to the langauge constructs. The main content of Section 2 is the new technique of the probabilistic alias analysis of SPMD programs. Section 4 concludes the paper and suggests directions for future work.

Probabilistic Alias analysis for SPMD
This section presents a new technique for probabilistic alias analysis of parallel programs. The parallelism model used here is that of SPMD where the same program is executed on distrusted machines havering different data.
However communications between the distributed machines is allowed in a predefined contexts. For example a command running on machine 1 may request machine 3 to evaluate a specific expression using data of machine 3 and to return the result to machine 1.
The syntax of the langauge used to present the new probabilistic alias analysis technique is shown in Figure 1. We call the langauge mode SSA-DisLang for ease of reference. A program in SSA-DisLang consists of a sequence of statements where statements are of wide diversity. Statements use (distributed) expressions, DExpr. The machines to run SSA-DisLang programs are typically organized in a hierarchy. The distributed expressions include the following: • malloc() : allocates a dynamic array in memory and return its base address. • run (e, m) : evaluates the distributed expression e on machine m and return the result. • reform(alis m, int m) e : casts the location denoted by the distributed expression e as an integer rather than a pointer to a memory location on machine m. • reform (int m j , int m i )) e : casts the location denoted by the distributed expression e as a pointer a memory location on machine m i rather than as a pointer to a memory location on machine m j . Our proposed technique assumes that the given program, that is to be be analyzed for its probabilistic alias competent, has the static single assignments form. Therefore the input program would contain annotations (added by any efficient SSA such as algorithm [11]). The program annotations will have the form of new statements added to the original program. Therefore statements of SSA-DisLang include the following: • l := e : this is a classical assignment command. However the design of the langauge allows using this command to assign a value evaluated at a machine to a location on a different machine of the machines hierarchy. • run (S, m) : allows evaluates a specific command S on a specific machine m regardless of the executing machine. This command is necessary when some commands are convenient only to run on data of certain machine of the hierarchy. The command is also used when security is a concern as S would not have access to all machines.
this command is to be added by the supposed SSA algorithm and it semantics is that variable x i were created specifically for avoiding multiple assignments to variable x. The range of this definition if form definition of variable x j to that of variable x k . • x i := md(x j ) : this is the second sort of annotations SSA-DisLang programs. The semantics of this statement is that it is highly likely that variable x i is used to define variable x j . Recall that our main technique of the paper cares about possibility of assignments to occur in   percentages; it is not a 0/1 technique. • mu(x j ): this is the third and last sort of annotations SSA-DisLang programs. The semantics of this command is that variable x j is highly likely to be used in the following de-reference command of the program. Figures 2, 3, and 4 present elements of our proposed technique for probabilistic alias analysis of SSA-DisLang programs. The proposed technique has the form of a type system which consists of set of alias types denoted by P and set of inference rules presented in the technique figures. An alias type is a partial map. The domain of this partial map is a subset of the set of all variables (denoting registers) allowed to be used on different machines of the distributed hierarchy plus the set of all addresses of memories of machines on hierarchy. The codomain of the alias type is the power set of the set of all probabilistic pairs. A probabilistic pair is a pair of variable (register) or a memory location and a number p such hat 0 ≤ p ≤ 1.
Judgment produced by the system have the forms e : P → a and S : P → P ′ . The judgement e : P → a means that evaluating the expression e in a memory state of the type P results in the memory address a. The semantics of the judgement e : P → a is that running S in a memory state of the type P results (if ends) in a memory state of the type P ′ . The proposed technique is meant to be used as follows. given a distributed program S, one constructs (using inference rules of the system) an alias type P ′ such that S : ⊥ → P ′ . The base type is the partial map with an empty domain is denoted by ⊥. The construction of P ′ is a type derivation process and results in annotating program with the required probabilistic alias information.
Inference rules for distributed expressions are shown in figure 3. Some comments on the rules are in order. The rules for reform expressions only considers the address evaluated from e if there is a considerable probability (probability threshold > p th ) of arriving at the concerned program point.
Inference rules for statements are shown in figure 4. Some comments on the rules are in order. The rule ([] p 3 ) uses the base address of the array denoted by l and the address returned for e by the inference rules of expressions. The image of these addresses under the pre-type also contribute to calculating the post type of the de-reference statement.
The soundness of our proposed technique is guarantied by the following theorem. The theorem requests the existence of robust operational semantics for the langauge SSA-DisLang. Many semantics candidates exist. Due to lack of space we only reference to the semantics in this paper. From the authors's experience and based on some experiments, the simplicity of the theorem proof deeply relies on the choice of the langauge semantics.
Theorem 1: Suppose that S is a SSA-DisLang program and S : ⊥ → P ′ . Suppose also that using a convenient operational semantics for SSA-DisLang, the execution of S is captured as S : M → M ′ . Then the final memory state M ′ is of the the probabilistic alias type P ′ .

Related Work
The changing associations characteristics property of pointers makes the points-to analysis a complicated problem [3]. Much research [12], [13], [14], [15] have been developed to solve the pointer analysis problem. Each of these techniques evaluates either points-to or aliases relationships at program points. Points-to and aliases relationships are classified into two classes: definitely-aliases (or must-points-to) relationships and may-points-to (or possiblyaliases relationships). While the later relationships are true on some executions, the former relationships are true on all executions. Wether possibly-aliases or may-points-to relationships are true on most executions or on few executions is not measurable by most of these techniques. For specific transformations and optimizations these missed information are beneficial. Few attempts were made to fill this gap.
Using traditional data-flow analysis, in [16], [17] a theoretical formulation is presented to compute measurable information. More specifically, this work evaluates, for each program point, the predicted count that specific conditions may hold. Aiming at evaluating, among array references, the probabilities of aliases, [18], [19], [20] presents a probabilistic technique for memory disambiguation. A probabilistic, interprocedural, contextsensitive, and flow-sensitive techniques for alias analysis were proposed in [3], [11], [21]. On alias relationships, these technique evaluate measurable information. MachSUIF and SUIF compiler infrastructures provided the bases for the implementation of these techniques. The probabilities of pointer induced, loop carried, and data dependence relationships were evaluated in [22], [23]. Using sparse matrices, as efficient linear transfer functions, [24], [25] modeled probabilistic alias analysis. The results of this research were proved accurate. [26] presents an algorithm to evaluate measurable alias information. A technique for memory disambiguation, evolution of probabilities that pairs of memory pointers point at the same memory location, is presented in [26].
For array optimizations and analysis, probabilistic techniques for memory disambiguation were proposed [18]. These techniques typically present data speculations [27] necessary for modern architectures of computers.
For distributed parallel machines with shared-memory, an important problem is that of compiler optimizations for programs that are pointer-based. This is so as the host processor of an object can be determined using data distribution analysis [28] and affinity analysis [29].
In, pointer-based programs, a reference is referencing a group of objects with may-points-to. For such cases, traditional affinity analysis [30] can be integrated with traditional pointer analysis. The result of this integration is a technique that evaluates the parts of objects on a processor's list of task executions. This is necessary for many program optimizations.
There are many examples of aggressive optimizations such as data speculations, speculative multithreading (thread partitioning), and code specialization [31], [32]. To boost performance of modern architectures, these optimizations are typically achieved by compilers. Compilers can only do such tasks if they are able to measure the possibility of dynamic pointer associations. Using interval analysis, irreducible flow graphs, and the elimination technique, intraprocedural analysis can be used to handle pointer analysis of programs [33]. Extensions to such techniques to cover context-sensitive analysis that is interprocedural is achievable as well.
Examples of analysis for speculative multithreading model include thread partitioning [34], [35], [36]. Such analysis boosts compilers performance via running speculative threads in case of low possibilities for conflicts. In this scenario for threads with high possibilities are turned off [22].

Conclusion and Future Work
This paper presented a new technique for probabilistic alias analysis of SPMD programs. The new approach has the form of system of inference rules. This has direct applications in proof-carrying code area of research. The proposed technique also has the advantage of assuming SSA forms of analyzed programs.
Directions for future work include the following. Producing probabilistic techniques for important analyses (such as dead-code elimination) for SPMD programs that uses the results of the analysis proposed in this paper would be an important contribution. Producing other analyses for the langauge model of this paper in the spirit of [37], [38], [39] is another direction for future work. There is also a need for precise probabilistic operational semantics for SPMD programs. This semantics would be important to accurately measure probabilities of statements executions and probabilities of executions order.