A method of optimizing a computer program includes executing a program including a hint defined as a variable in program and providing within the program, and a marker instruction that receives the hint as a parameter. The marker instruction marks a section of the computer program for a subsequent optimization. During the execution of the computer program, and in response to the marker instruction being executed, a hardware engine monitors data accesses associated with execution of instructions in the marked section and stores the data accesses in the storage of the hint. A subsequent execution of the marked section of the computer program is optimized using the data stored in the storage of the hint.