This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Tool/software:
Hi Champs,
Customer have found that our code takes a long time to run with judgment operation, which is much slower than other operations.
For example:
if (V2 == 1)
{
V3 = 1;
}This takes 0.1us to run
if ((V4 == 1U) && (V5 == 1U))
{
V6 = 1;
}This takes 0.142us to run
Customer tried to increase the optimization level, but the time did not decrease. Is there a way to reduce the running time of this logical operation? In addition, do we have a benchmark for logical operations that we can provide to customer?
Thanks!
Best Regards,
Julia
For one source file which contains code similar to ...
if (V2 == 1)
{
V3 = 1;
}This takes 0.1us to run
if ((V4 == 1U) && (V5 == 1U))
{
V6 = 1;
}This takes 0.142us to run
... please follow the directions in the article How to Submit a Compiler Test Case. So we know where to focus, please add a comment similar to /* PROBLEM HERE */.
Thanks and regards,
-George
Hi George,
I'll discuss with customer if they can provide test cases. We want to make sure that there is a benchmark related to the judgment statement?
Thanks!
Best Regards,
Julia
Hi Geodge,
Customer and I use below method to test the run clock, and below operations will cost 6~7 clock. Is this time can be reduced?
if (V2 == 1)
{
V3 = 1;
}
Best Regards,
Julia
Build with the compiler option --opt_level=2 or higher. So that the code which uses V2 and V3 is not completely removed, make them parameters to the current function, and pass them on as arguments to some other function. Put the other function in a different file.
Is this time can be reduced?
This change to a higher level of optimization will do it.
Thanks and regards,
-George