1. A method for optimizing a programmed movement path for an industrial robot holding a tool to carry out work along the path during a work cycle, wherein the movement path comprises information on positions and orientations for the tool at a plurality of target points on the movement path, the method comprising for at least one of the target points: receiving a tolerance interval for the orientation of the tool in the target point, determining movements of the robot between the target point and one or more of the other target points on the path for a plurality of different tool orientations within the tolerance interval, selecting one of the different tool orientations as the tool orientation for the target point based on the determined movements of the robot and with regard to minimizing cycle time, and generating a robot program based on the selected orientation of the tool at the target point.