| CPC G06F 8/41 (2013.01) | 20 Claims |

|
1. A computer program product for facilitating processing within a computing environment, the computer program product comprising:
one or more computer readable storage media and program instructions collectively stored on the one or more computer readable storage media to perform a method comprising:
performing, by a compiler executing on a processor, a value range analysis of computer code that is selected, the value range analysis tracking one or more ranges of values for one or more selected variables of the computer code at one or more points in execution of the computer code, and the value range analysis generating value range information;
performing, by the compiler, a multi-phase idiom recognition process to search the computer code being compiled by the compiler for one or more idioms and confirming based on finding the one or more idioms in the computer code that the one or more idioms found actually correspond to one or more particular known idioms, the performing the multi-phase idiom recognition process comprising:
performing, during the multi-phase idiom recognition process, code pattern matching within the computer code to determine whether there is a match in the computer code, according to one or more selected conditions, to an idiom from a predefined set of idioms
based on determining that there is the match in the computer code to the idiom from the predefined set of idioms, confirming, during the multi-phase idiom recognition process, that the idiom found in the computer code is actually a particular known idiom, the confirming comprising:
providing, based on determining that the computer code includes the idiom from the predefined set of idioms, a set of data items of the idiom to be analyzed against the value range information generated from the value range analysis and one or more corresponding values taken from the computer code representing the idiom that is the match;
providing a reference set of data items, representing the idiom, to be used to transform the computer code based on confirming the idiom is the particular known idiom; and
analyzing, based on a set of constraints defined for the particular known idiom, the set of data items of the idiom with respect to the one or more corresponding values taken from the computer code and the value range information generated from the value range analysis to determine whether the set of data items satisfy one or more predefined conditions for the particular known idiom, wherein the idiom is confirmed as the particular known idiom based on the set of data items satisfying the one or more predefined conditions for the particular known idiom; and
transforming, by the compiler, the computer code being compiled to provide revised computer code, the transforming comprising replacing, based on confirming that the idiom found in the computer code is the particular known idiom, one or more code segments of the computer code with replacement code to provide the revised computer code, wherein the replacement code is a selected expression of the particular known idiom and uses the reference set of data items; and
compiling, using the compiler, the revised computer code improving execution performance of the computer code.
|