Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
29594 Обсуждение

What on earth is a basic block

awa5114
Начинающий
2 407Просмотр.

In the ifort documentation for code coverage, light yellow stands for 'Partially Covered Code'.

Its description runs as follows:

Indicates that more than one basic block was generated for the code at this position. Some of the blocks were covered and some were not. You can override the default color with the -pcolor tool option

What on earth and in the seven heavens is a "basic block"? This could be anything to the uninformed reader. Could be a variable declaration, a whole module, a program.

What is this mysterious entity? Does it have anything to do with this? https://www.obliquity.com/computer/fortran/common.html

 

 

0 баллов
3 Ответы
Arjen_Markus
Почетный участник II
2 407Просмотр.

In the context of code coverage a basic block is a fragment of code that will be executed without any interruption.

For instance:

do i =1,10
    read( 20, * ) value(i)
    write( 30, * ) i, value(i)
enddo

The two lines inside the do-loop form a basic block as there is no (visible) means to leave the fragment. If you were to insert a "err = label" statement that would change, as then there is a way of jumping out of the fragment.

awa5114
Начинающий
2 407Просмотр.

Allright, so if I find a line that is light yellow in my coverage report, what does that actually mean?

Arjen_Markus
Почетный участник II
2 407Просмотр.

My guess - but I immediately acknowledge that I am not an expert in this area - is that the compiler generated multiple instances of the code in question in order to optimise it. This may mean things like: generate one version of a routine with optional arguments in which the argument is not present and one in which it is. Not knowing your code I can only make such guesses.

Ответить