IP Library Granted Patent US 12,730,619
Granted Patent B2
US 12,730,619 · App. 18/441,647 · Granted Sep 8, 2026

Source code optimization

Inventors: Tyler Steele (Edmonton, CA); Jordan Gillette (North York, CA); Reid Copeland (Ontario, CA); Muhammad Suhaib Tahir Saleem (Toronto, CA); Jacqueline Midroni (Toronto, CA)
Assignee: International Business Machines Corporation
G06F8/447G06F8/443G06F8/72
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,730,619
App. No.
18/441,647
Granted
Sep 8, 2026
Kind
B2
Abstract

A computer implemented method optimizes source code. A processor set receives a source code in a first version. The processor set compiles the source code in the first version to generate an intermediate representation for the source codes in the first version. The processor set compares the intermediate representation for the source code in the first version to a number of optimization paths. The processor set identifies a number of matches based on the comparisons. The processor set updates at least a portion of the source code in the first version to the second version based on the number of matches to generate the source code in the second version.

Claims (61)

1 . A computer implemented method for optimizing source code, the computer implemented method comprising:

receiving, by a processor set, a source code in a first version;

compiling, by the processor set, the source code in the first version to generate an intermediate representation for the source code in the first version;

comparing, by the processor set, the intermediate representation for the source code in the first version to a number of optimization paths, wherein the number of optimization paths are data structures that comprise information for converting the source code in the first version to the source code in a second version, and wherein the number of optimization paths are stored as mappings between fragments of the intermediate representation and corresponding portions of the source code in the second version of the source code in an optimization path library;

identifying, by the processor set, a number of matches based on the comparisons, wherein each match from the number of matches comprises a fragment of the intermediate representation and corresponding portion of the source code in the second version for the fragment of the intermediate representation based on an optimization path from the number of optimization paths stored in the optimization path library; and

updating, by the processor set, at least a portion of the source code in the first version to the second version based on the number of matches to generate the source code in the second version.

2 . The computer implemented method of claim 1 further comprising:

tagging, by the processor set, the portion of the source code in the first version based on the number of matches for review.

3 . The computer implemented method of claim 1 , wherein the updating, by the processor set, the at least the portion of the source code in the first version to the second version based on the number of matches to generate the source code in the second version comprises:

presenting, by the processor set, the number of matches in a graphical user interface;

selecting, by the processor set based on a user input, a subset of matches from the number of matches; and

updating, by the processor set, the at least the portion of the source code in the first version to the second version based on the selected subset of matches to generate the source code in the second version.

4 . The computer implemented method of claim 1 , wherein the identifying, by the processor set, the number of matches based on the comparisons comprises:

organizing, by the processor set, the number of optimization paths in a hierarchical manner such that the identification for the number of matches is proceeded from first optimization paths from the number of optimization paths to a last optimization from the number of optimization paths; and

terminating, by the processor set, the identification for the number of matches upon identifying a first match.

5 . The computer implemented method of claim 1 , wherein the comparing, by the processor set, the intermediate representation for the source code in the first version to the number of optimization paths comprises:

comparing, by the processor set, each section of the intermediate representation to each optimization path from the number of optimization paths.

6 . The computer implemented method of claim 1 , wherein the intermediate representation and the number of optimization paths are in the same syntax specified by a complier vendor.

7 . The computer implemented method of claim 1 , wherein the intermediate representation excludes information related to variable names in the source code in the first version.

8 . A computer system comprising:

a processor set;

a set of one or more computer-readable storage media; and

program instructions, collectively stored in the set of one or more computer-readable storage media, for causing the processor set to:

receive a source code in a first version;

compile the source code in the first version to generate an intermediate representation for the source code in the first version;

compare the intermediate representation for the source code in the first version to a number of optimization paths, wherein the number of optimization paths are data structures that comprise information for converting the source code in the first version to the source code in a second version, and wherein the number of optimization paths are stored as mappings between fragments of the intermediate representation and corresponding portions of the source code in the second version of the source code in an optimization path library;

identify a number of matches based on the comparisons, wherein each match from the number of matches comprises a fragment of the intermediate representation and corresponding portion of the source code in the second version for the fragment of the intermediate representation based on an optimization path from the number of optimization paths stored in the optimization path library; and

update at least a portion of the source code in the first version to the second version based on the number of matches to generate the source code in the second version.

9 . The computer system of claim 8 , wherein the program instructions, collectively stored in the set of one or more storage media, cause the processor set to:

tag the portion of the source code in the first version based on the number of matches for review.

10 . The computer system of claim 8 , wherein as part of the updating the at least the portion of the source code in the first version to the second version based on the number of matches to generate the source code in the second version, the program instructions, collectively stored in the set of one or more storage media, cause the processor set to:

present the number of matches in a graphical user interface;

select a subset of matches from the number of matches based on a user input; and

update the at least the portion of the source code in the first version to the second version based on the selected subset of matches to generate the source code in the second version.

11 . The computer system of claim 8 , wherein as part of the identifying the number of matches based on the comparisons, the program instructions, collectively stored in the set of one or more storage media, cause the processor set to:

organize the number of optimization paths in a hierarchical manner such that the identification for the number of matches is proceeded from first optimization paths from the number of optimization paths to a last optimization from the number of optimization paths;

and terminate the identification for the number of matches upon identifying a first match.

12 . The computer system of claim 8 , wherein the comparing the intermediate representation for the source code in the first version to the number of optimization paths, the program instructions, collectively stored in the set of one or more storage media, cause the processor set to:

compare each section of the intermediate representation to each optimization path from the number of optimization paths.

13 . The computer system of claim 8 , wherein the intermediate representation and the number of optimization paths are in the same syntax specified by a complier vendor.

14 . The computer system of claim 8 , wherein the intermediate representation excludes information related to variable names in the source code in the first version.

15 . A computer program product for optimizing source code, the computer program product comprising:

a set of one or more computer-readable storage media; and

program instructions, collectively stored in the set of one or more computer-readable storage media, for causing a processor set to:

receive source code in a first version;

compile the source code in the first version to generate an intermediate representation for the source code in the first version;

compare the intermediate representation for the source code in the first version to a number of optimization paths, wherein the number of optimization paths are data structures that comprise information for converting the source code in the first version to the source code in a second version, and wherein the number of optimization paths are stored as mappings between fragments of the intermediate representation and corresponding portions of the source code in the second version of the source code in an optimization path library;

identify a number of matches based on the comparisons, wherein each match from the number of matches comprises a fragment of the intermediate representation and corresponding portion of the source code in the second version for the fragment of the intermediate representation based on an optimization path from the number of optimization paths stored in the optimization path library; and

update at least a portion of the source code in the first version to the second version based on the number of matches to generate the source code in the second version.

16 . The computer program product of claim 15 , wherein program instructions, collectively stored in the set of one or more storage media further cause the processor set to:

tag the portion of the source code in the first version based on the number of matches for review.

17 . The computer program product of claim 15 , wherein as part of the updating the at least the portion of the source code in the first version to the second version based on the number of matches to generate the source code in the second version, the program instructions cause the processors set to:

present the number of matches in a graphical user interface;

select a subset of matches from the number of matches based on a user input; and

update the at least the portion of the source code in the first version to the second version based on the selected subset of matches to generate the source code in the second version.

18 . The computer program product of claim 15 , wherein as part of the identifying the number of matches based on the comparisons, the program instructions cause the processors set to:

organize the number of optimization paths in a hierarchical manner such that the identification for the number of matches is proceeded from first optimization paths from the number of optimization paths to a last optimization from the number of optimization paths; and

terminate the identification for the number of matches upon identifying a first match.

19 . The computer program product of claim 15 , wherein the comparing the intermediate representation for the source code in the first version to the number of optimization paths, the program instructions cause the processors set to:

compare each section of the intermediate representation to each optimization path from the number of optimization paths.

20 . The computer program product of claim 15 , wherein the intermediate representation and the number of optimization paths are in the same syntax specified by a complier vendor.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 4, 2024
From: STEELE, TYLER; GILLETTE, JORDAN; COPELAND, REID; SALEEM, MUHAMMAD SUHAIB TAHIR; MIDRONI, JACQUELINE
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 066636/0178 →
Continuity (1)
Related Publication 20260086786A1 · Mar 26, 2026
References Cited (21)
US 7231633B2 · Grassens · 2007 [cited by applicant]
US 8015554B2 · Varma · 2011 [cited by applicant]
US 8943472B1 · Ganelin · 2015 [cited by applicant]
US 9213541B2 · Araya et al. · 2015 [cited by applicant]
US 9411581B2 · Peled · 2016 [cited by applicant]
US 10324695B2 · Champagne · 2019 [cited by applicant]
US 10430180B2 · Kakhandiki et al. · 2019 [cited by applicant]
US 11061652B1 · Biswas et al. · 2021 [cited by applicant]
US 11074047B2 · Makkar · 2021 [cited by applicant]
US 11093240B2 · Makkar · 2021 [cited by applicant]
US 20050138606A1 · Basu et al. · 2005 [cited by applicant]
US 20060155539A1 · Chen et al. · 2006 [cited by applicant]
US 20080222616A1 · Cheng et al. · 2008 [cited by applicant]
US 20130086565A1 · Gaster · 2013 [cited by examiner]
US 20200310768A1 · Zhang · 2020 [cited by examiner]
US 20230195727A1 · Jain · 2023 [cited by examiner]
CA 2949251C · 2019 [cited by applicant]
CN 117008916A · 2023 [cited by examiner]
WO WO2021035553A1 · 2021 [cited by examiner]
Murat Bolat; Source Code Partitioning in Program Optimization; IEEE; pp. 5663; retrieved on Mar. 30, 2026 (Year: 2011). [cited by examiner]
Dennis J. Frailey ; An Intermediate Language for Source and Target Independent Code Optimization; ACM; pp. 188-200; retrieved on Mar. 30, 2026 (Year: 1979). [cited by examiner]