[PATCH] D62604: [CodeGen] Generic Hardware Loop Support

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 23:33:57 PDT 2019


samparker marked 2 inline comments as done.
samparker added inline comments.


================
Comment at: lib/CodeGen/HardwareLoops.cpp:326
+  ExitCount = SE.getAddExpr(ExitCount, SE.getOne(CountType));
+  Value *Count = SCEVE.expandCodeFor(ExitCount, CountType,
+                                     BB->getTerminator());
----------------
hfinkel wrote:
> Are you sure that isSafeToExpand[At] will always be true here? I recommend checking explicitly and then dealing in the callers of this function with the fact that it might fail.
Thanks, I'll look into it.


================
Comment at: lib/Target/PowerPC/PPCTargetTransformInfo.h:56
   TTI::PopcntSupportKind getPopcntSupport(unsigned TyWidth);
+  bool mightUseCTR(BasicBlock *BB, TargetLibraryInfo *LibInfo);
+  bool isHardwareLoopProfitable(Loop *L, ScalarEvolution &SE,
----------------
hfinkel wrote:
> This can't have this name here, as CTR refers to a PowerPC-specific register. Shouldn't this just be folded into the isHardwareLoopProfitable implementation?
I don't understand why that is, since this in a PowerPC-specific file. But I could probably just make it static.


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

https://reviews.llvm.org/D62604





More information about the llvm-commits mailing list