Patent ID: 7890942

Claim:
A method of substituting array values in a program in a computing environment at compile time, comprising: identifying an initialization of an array, said identifying performed at a compile time of a program being compiled by a compiler of a computer system, said initialization including an assignment of an expression to a plurality of elements of said array via a loop in said program, wherein said expression is selected from the group consisting of a constant value and a function of an induction variable of said loop, said induction variable capable of being evaluated to each value of a set of values; storing, at said compile time and subsequent to said identifying said initialization of said array, said expression in a table residing in a memory, said table associating said expression with said array and with a plurality of indices of said array, said plurality of indices being dependent upon a subset of said set of values; detecting, at said compile time and subsequent to said storing said expression in said table, at least one element of said plurality of elements of said array on the right side of an assignment statement included in said program, wherein said at least one element of said plurality of elements is to be assigned by said assignment statement, said at least one element associated with at least one index of said plurality of indices in a one-to-one correspondence, and wherein said assignment statement is different from said assignment of said expression to said plurality of elements of said array via said loop; retrieving, at said compile time and in response to said detecting said at least one element on the right side of said assignment statement, said expression from said table, said retrieving based on said expression being associated by said table with said array and with said at least one index; and substituting, into said assignment statement included in said program and at said compile time, said expression retrieved from said table for said at least one element detected on the right side of said assignment statement so that said expression replaces said at least one element on the right side of said assignment statement and is to be assigned by an execution of said assignment statement instead of said at least one element being assigned by said execution of said assignment statement.