Sources of optimization of basic blocks

SOURCES OF OPTIMIZATION OF BASIC BLOCKS:


Basic blocks of codes are the number of instructions exist in a source code, which are executed sequentially.

Basic blocks are sequence of codes.


Some of the statements which ends sequence of codes and give born to basic blocks are, If Else, Switch Case, Do While, etc.


For example:
Take source code as shown below.

a = 0;
b = b+c;
c = 0;
If (a>d)
{
c = b;
b++;
}
else
{
c = d;
d++;
}
a= b+d;
Basic blocks in above source code are-
(1)
(2)
(3)
(4)
a = 0;
b = b+c;
c = 0;
c = b;
b++;
c = d;
d++;
a= b+d;

Basic blocks are useful in finding repeated variables, used in same basic clock.

Related topics

Professor Jayesh video tutorial

Please use contact page in this website if you find anything incorrect or you want to share more information about the topic discussed above.