Discussion
Loading...

#Tag

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
d@nny disc@ mc²
d@nny disc@ mc² boosted
pinskia
@pinskia@hachyderm.io  ·  activity timestamp 2 months ago
@hipsterelectron @dragon I tend to believe the #prgama/optimization attribute for optimizations should really only be used for debugging purposes. There are other ways to do things without them. E.g the noipa, noclone, noipa attributes (note clang only knows about the noinline one). Compiler barriers could be used too.

Or the new #pragama to mark loops to unroll or not to vectorize.
The ` #pragma openmp simd` one could used with just -fopenmp-simd and you dont need the full openmp support is another example there.

The ones for #pragma/attribute to change the target are valid uses in headers though.

Note the #pragma for optimization is supposed to change the OPTIMIZATION macro but that is broken with gcc' c++ frontend until a few weeks ago (I pushed a fix for it).

  • Copy link
  • Flag this post
  • Block
d@nny disc@ mc²
@hipsterelectron@circumstances.run  ·  activity timestamp 2 months ago
@dragon i actually think this is a terrible idea because optimization settings should be under the control of the end user not the upstream codebase. i'm not sure of a way to thread this because generally compilers don't give you the ability to select specific types of optimization passes to perform, just a generic set of all passes under the 0-3 optimization levels. having a semantic query language for optimization passes which can be matched against whatever compiler would be pretty cool tbh but as is this seems worse than useless. cc @pinskia wondering if you would agree
pinskia
@pinskia@hachyderm.io replied  ·  activity timestamp 2 months ago
@hipsterelectron @dragon I tend to believe the #prgama/optimization attribute for optimizations should really only be used for debugging purposes. There are other ways to do things without them. E.g the noipa, noclone, noipa attributes (note clang only knows about the noinline one). Compiler barriers could be used too.

Or the new #pragama to mark loops to unroll or not to vectorize.
The ` #pragma openmp simd` one could used with just -fopenmp-simd and you dont need the full openmp support is another example there.

The ones for #pragma/attribute to change the target are valid uses in headers though.

Note the #pragma for optimization is supposed to change the OPTIMIZATION macro but that is broken with gcc' c++ frontend until a few weeks ago (I pushed a fix for it).

  • Copy link
  • Flag this comment
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.2.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login