A method of operating a data processing system which includes a programmable processing stage that executes instructions to perform processing operations, in which execution threads may be grouped together into thread groups in which the plural threads of a thread group can each execute a set of instructions in lockstep, one instruction at a time;
- the method comprising:
- for a program comprising a set of instructions for execution by a programmable processing stage of the data processing system:
- for an instruction in the set of instructions that will obtain external input data from a source that is external to the programmable processing stage:
- determining whether the instruction that will obtain external input data from a source that is external to the programmable processing stage is followed by one or more subsequent instructions that will use the external data and that would produce the same result for plural threads of a thread group were those plural threads each to execute the one or more subsequent instructions using the same external input data;
- and
- when it is determined that an instruction that will obtain external input data from a source that is external to the programmable processing stage is followed by one or more subsequent instructions that will use the external data and that would produce the same result for plural threads of a thread group were those plural threads each to execute the one or more subsequent instructions using the same external input data:
- associating with the instruction that will obtain external input data from a source that is external to the programmable processing stage an indication that it is followed by is followed by one or more subsequent instructions that will use the external data and that would produce the same result for plural threads of a thread group were those plural threads each to execute the one or more subsequent instructions using the same external input data;
- the method further comprising:
- the programmable processing stage:
- receiving the set of instructions for execution by the programmable processing stage;
- and
- executing the set of instructions for a thread group comprising plural execution threads;
- the executing the set of instructions for the thread group comprising:
- for an instruction that will obtain external input data from a source that is external to the programmable processing stage:
- executing the instruction for each thread of the thread group to obtain external input data for each thread of the thread group;
- determining whether the instruction that will obtain external input data from a source that is external to the programmable processing stage has associated with it an indication that it is followed by one or more subsequent instructions that will use the external data and that would produce the same result for plural threads of a thread group were those plural threads each to execute the one or more subsequent instructions using the same external input data;
- and
- determining whether the obtained external input data is the same for plural threads of the thread group;
- and
- when it is determined that the instruction that will obtain external input data from a source that is external to the programmable processing stage has associated with it an indication that it is followed by one or more subsequent instructions that will use the external data and that would produce the same result for plural threads of a thread group were those plural threads each to execute the one or more subsequent instructions using the same external input data, and it is determined that the external input data is not the same for plural threads of the thread group:
- executing the one or more subsequent instructions that will use the external data and that would produce the same result for plural threads of a thread group were those plural threads each to execute the one or more subsequent instructions using the same external input data, for each of the plural threads of the thread group individually;
- when it is determined the instruction that will obtain external input data from a source that is external to the programmable processing stage has associated with it an indication that it is followed by one or more subsequent instructions that will use the external data and that would produce the same result for plural threads of a thread group were those plural threads each to execute the one or more subsequent instructions using the same external input data, and it is determined that the external input data is the same for plural threads of the thread group:
- executing the one or more subsequent instructions that will use the external data and that would produce the same result for plural threads of a thread group were those plural threads each to execute the one or more subsequent instructions using the same external input data, for only a single thread of the plural threads.