Gather warnings in a code with plain memory layout

248 views
Skip to first unread message

Tomek

unread,
Jul 19, 2019, 4:03:19 AM7/19/19
to Intel SPMD Program Compiler Users
Hi,

It's great that we can now use per line "#pragma ignore warning". Thank you for that:)!

And, I still don't understand why such simple routine:

export void translate (uniform REAL vector[], uniform REAL x[], uniform REAL y[], uniform REAL z[], uniform size_t size)

{

  foreach (i = 0 ... size)

  { 

    x[i] += vector[0];

    y[i] += vector[1];

    z[i] += vector[2];

  }

}


is issuing warnings like that:


ispc/util.ispc:8:5: Performance Warning: Gather required to load value. 

    x[i] += vector[0];


without these pragmas?


Is this really a case, where the compiler is not able to deduce that the memory access can be done using vector instructions? I would suppose that the structure of this subroutine is making everything plain. How can we make this routine not generate such warnings (without pragmas)?


Thank you:)

Tomek

Dmitry Babokin

unread,
Jul 19, 2019, 4:50:34 PM7/19/19
to ispc-...@googlegroups.com
Hi Tomek,

We do have some problems with gathers optimization. But in this particular case I don't see any warnings.


Please send more complete example (in your code snippet it's not clean what REAL is), the link to godbolt.org would be ideal. And the version of ISPC that you are using.

Dmitry.

--
You received this message because you are subscribed to the Google Groups "Intel SPMD Program Compiler Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ispc-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ispc-users/3c2edff1-3b12-421c-bb6d-7e3f6e44376b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tomek

unread,
Jul 29, 2019, 4:53:27 AM7/29/19
to Intel SPMD Program Compiler Users
Hi,

Just the same code, that you pasted on goldbolt, when being compiled in a console, issues these "Performance Warnings" when compiled in debug mode (with version 1.11.0), but not in release mode. Why is this needed in debug mode, if ispc knows how to generate efficient instructions? See the mini project, attached (type "make" or "make release" inside). It's just about cluttering the console when we develop - to remove these type of warnings we need to use many pragmas:)

Tomek


On Friday, July 19, 2019 at 10:50:34 PM UTC+2, Dmitry Babokin wrote:
Hi Tomek,

We do have some problems with gathers optimization. But in this particular case I don't see any warnings.


Please send more complete example (in your code snippet it's not clean what REAL is), the link to godbolt.org would be ideal. And the version of ISPC that you are using.

Dmitry.

On Fri, Jul 19, 2019 at 1:03 AM Tomek <t.ko...@gmail.com> wrote:
Hi,

It's great that we can now use per line "#pragma ignore warning". Thank you for that:)!

And, I still don't understand why such simple routine:

export void translate (uniform REAL vector[], uniform REAL x[], uniform REAL y[], uniform REAL z[], uniform size_t size)

{

  foreach (i = 0 ... size)

  { 

    x[i] += vector[0];

    y[i] += vector[1];

    z[i] += vector[2];

  }

}


is issuing warnings like that:


ispc/util.ispc:8:5: Performance Warning: Gather required to load value. 

    x[i] += vector[0];


without these pragmas?


Is this really a case, where the compiler is not able to deduce that the memory access can be done using vector instructions? I would suppose that the structure of this subroutine is making everything plain. How can we make this routine not generate such warnings (without pragmas)?


Thank you:)

Tomek

--
You received this message because you are subscribed to the Google Groups "Intel SPMD Program Compiler Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ispc-...@googlegroups.com.
ispc0warn.zip

Dmitry Babokin

unread,
Jul 31, 2019, 1:34:55 PM7/31/19
to ispc-...@googlegroups.com
Totally agree, when running with -O0 we should disable those performance warnings that are affected by optimizations. Those which doesn't depend on optimizations should probably still fire. Do you agree?

I've filed #1538 for that.



To unsubscribe from this group and stop receiving emails from it, send an email to ispc-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ispc-users/2f7da176-20e9-478e-8990-7b64c91c87eb%40googlegroups.com.

Tomek

unread,
Aug 6, 2019, 3:34:18 PM8/6/19
to Intel SPMD Program Compiler Users
Yes, I think it's a good idea:) Thanks.
Reply all
Reply to author
Forward
0 new messages