[PATCH] D62164: [PowerPC] Enable MachinePipeliner for P9 with -ppc-enable-pipeliner

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 29 14:01:01 PDT 2019


hfinkel added inline comments.


================
Comment at: llvm/lib/Target/PowerPC/PPCInstrInfo.cpp:3936
+
+MachineInstr *PPCInstrInfo::findLoopInstr(
+    const MachineBasicBlock &BB, unsigned EndLoopOp,
----------------
jsji wrote:
> hfinkel wrote:
> > FWIW, I find this method a bit strange. Do we need have a MachineLoopInfo available such that we could just check in the preheader of the loop?
> In short, yes. 
> MachinePipeliner have MachineLoopInfo, and it also make sure that we call `reduceLoopCount` with prolog MBBs that set up the pipeline, so we are safe to assume that `the loop set-up instruction will be in a predecessor block` only.
I'd not give it a 100% guarantee, but if you only check in the preheader, do you miss anything?

(you could check, perhaps, by putting an assert in the current logic to see if you every find the mtctr in some block other than the preheader).


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D62164/new/

https://reviews.llvm.org/D62164





More information about the llvm-commits mailing list