[LLVMdev] Proposal for ""llvm.mem.vectorize.safelen"

Robison, Arch arch.robison at intel.com
Tue Aug 12 14:50:44 PDT 2014


> Remember that this annotation is saying that "the loop *as it is* is 
> safe in a N vector", but things can change between the annotation 
> (generally source code pragmas, but could be a Polly thing) and actual 
> vectorization. 

Because other transformations might introduce recurrences that break vectorization,
the "safelen" annotation probably should be structured more like 
llvm.mem.parallel_loop_access, and be attached to every load/store of interest.

I'm imagining that the high level interface would be a method:

	int32_t Loop::GetAnnotatedVectorSafelen()

that would do the inspection, much as Loop::IsAnnotatedParallel() currently indicates
whether a loop is parallel.  The return value would be 0 for unannotated loops
and an upper bound on the vector width otherwise.

- Arch





More information about the llvm-dev mailing list