[cfe-dev] Pass Manager changes - Pragma optimize

Renato Golin renato.golin at linaro.org
Mon Dec 2 05:39:47 PST 2013


Hi Chandler,

I'm looking at vectorizer pragmas (http://llvm.org/PR18086):

#pragma vectorize enable/disable

Simply turns the vectorizer on/off on that loop. This doesn't
guarantee that the loop will get vectorized if it's not legal, but it
will enable the vectorizer even if the optimization level is too low.

This means that I'll leave to the vectorizer pass the decision to
vectorize or not, even on low optimization levels (-O0, -O1, -Oz), if
the pragma is present.

My naive implementation is *always* adding the vectorizer pass, with a
flag if it should check for pragmas or just vectorize. Does that make
sense in your refactoring of the pass manager?

Additional pragmas/attributes  (optimize name/level) will do the same
thing on a global scale. Is that something you're planning on your
refactoring? If so, how would you do it in the new scheme, so I can be
the least disruptive possible for your changes when implementing the
vectorization pragma?

cheers,
--renato



More information about the cfe-dev mailing list