[llvm-commits] [PATCH/RFC] Loop Data Software Prefetching

Hal Finkel hfinkel at anl.gov
Tue Jan 29 15:22:45 PST 2013


----- Original Message -----
> From: "Nadav Rotem" <nrotem at apple.com>
> To: "Hal Finkel" <hfinkel at anl.gov>
> Cc: "Evan Cheng" <evan.cheng at apple.com>, "l >> Commit Messages and Patches for LLVM" <llvm-commits at cs.uiuc.edu>
> Sent: Tuesday, January 29, 2013 4:58:45 PM
> Subject: Re: [llvm-commits] [PATCH/RFC] Loop Data Software Prefetching
> 
> 
> +// Loop data prefetching.
> +static cl::opt<unsigned>
> +L1CacheLineSize("l1-cache-line-size", cl::init(64), cl::Hidden,
> +  cl::desc("The size of the an L1 cache line"));
> +
> +static cl::opt<bool>
> +LoopDataPref("prefetch-loop-data", cl::init(false), cl::Hidden,
> +  cl::desc("Prefetch loop data"));
> +
> +static cl::opt<unsigned>
> +LoopDataPrefDist("loop-data-prefetch-distance", cl::init(300),
> cl::Hidden,
> +  cl::desc("Loop data prefetch code-metric distance"));
> +
> +static cl::opt<bool>
> +PrefetchWrites("loop-data-prefetch-writes", cl::init(false),
> cl::Hidden,
> +  cl::desc("Prefetch writes in loops"));
> +
> 
> Hi Hal,
> 
> I don't think that adding command line flags to TTI is the right way
> to go. 

I don't like it either really ;)

> After chandler's refactoring to TTI you can now chain
> multiple TTI analysis one after the other. You can implement your
> own TTI that will override the default TTI. Much like X86 overrides
> the basic TTI which overrides NoTTI.

The problem is that this makes experimenting difficult; changing anything would require recompiling -- and it makes it impossible for the user to override the behavior. If I add the command line flags, for example, to PPCTTI, then I'd need to use different flags in X86TTI, and connecting all of these flags with clang flags becomes messy.

What do you suggest?

Thanks again,
Hal

> 
> 
> On Jan 29, 2013, at 12:39 PM, Hal Finkel <hfinkel at anl.gov> wrote:
> 
> > <loopdatapref.patch>
> 
> 



More information about the llvm-commits mailing list