[PATCH] #pragma vectorize

Hal Finkel hfinkel at anl.gov
Tue Apr 22 12:33:50 PDT 2014


----- Original Message -----
> From: "Nadav Rotem" <nrotem at apple.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "Tyler Nowicki" <tnowicki at apple.com>, "Alexey Bataev" <alexey.bataev at intel.com>, "llvm cfe"
> <cfe-commits at cs.uiuc.edu>
> Sent: Tuesday, April 22, 2014 2:26:32 PM
> Subject: Re: [PATCH] #pragma vectorize
> 
> 
> 
> 
> On Apr 22, 2014, at 12:07 PM, Hal Finkel < hfinkel at anl.gov > wrote:
> 
> 
> Hrmm; interesting. Is this the behavior we want? I'd be inclined to
> say that the pragma should imply safety.
> 
> 
> I prefer to implement ‘unsafe’ vectorization with a separate pragma
> keyword. I would like to discourage users from using this option
> because it can break the correctness of their program, and I think
> that ’safe’ is a better default. Vectorizing a loop in an ‘unsafe’
> mode adds a risk and marking the loop with the ‘unsafe’ keyword
> makes the decision explicit and documents.
> I think that it is reasonable to require users to write: #pragma
> vectorize unsafe width(4) …

Okay, I misunderstood. So neither of the proposed pragmas imply safety? For consistency, that's better.

I think that, for both, we should have safety-implying variants (or should we use something else entirely for that? ivdep?). FWIW, I don't like 'unsafe', I'd like something closer to 'force' (but I don't like that either because it cannot always be forced). It is really an assertion about iteration independence. But if neither currently imply safety, then the 'unsafe' support can go into a different patch.

 -Hal

> 
> 
> Thanks,
> Nadav

-- 
Hal Finkel
Assistant Computational Scientist
Leadership Computing Facility
Argonne National Laboratory




More information about the cfe-commits mailing list