[PATCH] D24525: [Power9] Processor Model for Scheduling
Ehsan Amiri via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 21 18:39:19 PDT 2016
amehsan added inline comments.
================
Comment at: lib/Target/PowerPC/PPCTargetMachine.cpp:302
@@ +301,3 @@
+ : TargetPassConfig(TM, PM) {
+ if (TM->isPWR9() && TM->getOptLevel() != CodeGenOpt::None)
+ substitutePass(&PostRASchedulerID, &PostMachineSchedulerID);
----------------
echristo wrote:
> No, this won't work. The subtarget can change on a function by function basis so you'll need to come up with an alternate way to do this.
>
> Let's see what we can come up with...
I did not know that subtarget object owned by PPCTargetMachine will be removed. Anyway, I am thinking of a solution along this lines (not entirely verified it though):
First we create a hook for adding PostRA sched pass. Then for PPC we add both PostRA schedulers to the pipeline. In the beginning of the run method for each pass, we add a target specific hook. For PPC we check target-cpu of the machine function. Does this sounds reasonable? (I still need to verify that P8Model will be available for functions with target-cpu=pwr8 when a module is compile with -mcpu=pwr9).
https://reviews.llvm.org/D24525
More information about the llvm-commits
mailing list