[PATCH] Add a SubTargetFeature to enable Post RA Scheduling

hfinkel at anl.gov hfinkel at anl.gov
Wed Jun 18 00:52:21 PDT 2014


>>! In D4183#6, @spatel wrote:
> Hi Hal,
> 
> Thanks for looking at this. I agree that PostRA isn't a real subtarget feature, but using a processor model list (and a weirdly defined one at that - Atom, SLM, Other?) as a proxy for a pass seemed even worse. The existing code that asks "isAtom()" or "isSLM()" to decide about unrolling or changing LEAs feels wrong to me; we should be specifying the feature that we're interested in enabling directly rather than by asking what the CPU is. Is there a better way?

I think that (late) unrolling is actually a good model for how this should be handled. There are two pieces:

 1. The PassManagerBuilder has a DisableUnrollLoops flag for use by clang/opt (the corresponding technique here is to add a flag to TargetOptions for use by clang/llc)

 2. The target unrolling size is a property of the target, and is specified in the scheduling model. Likewise, whether the scheduling model is setup for post-RA scheduling (and whether this is likely to be useful) should be kept with the scheduling mode. For late unrolling, a LoopMicroOpBufferSize flag was added to the scheduling model. A corresponding flag could be added to control the default here. Also, Andy recently added a enablePostMachineScheduler() hook in TargetSubtargetInfo (and it could use this new model flag to provide the default instead of having a default of 'false').

Thanks again,
Hal

> 
> Our motivation here is that we'd like to eventually add Post RA scheduling by default when selecting the AMD btver2 target and possibly others. The existing enum and the CPU-based if-check will just grow over time if we leave it as-is. We'd also like to be able to optionally turn postRA scheduling off in llc and up in clang too.

http://reviews.llvm.org/D4183






More information about the llvm-commits mailing list