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

Markus Lavin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 06:08:06 PDT 2019


markus added inline comments.


================
Comment at: include/llvm/Analysis/TargetTransformInfo.h:468
+                                          // in the loop via a phi?
+    bool RequiresNewPreheader = false;
+  };
----------------
samparker wrote:
> markus wrote:
> > I find this confusing. I understand that a preheader is required for the transformation (because that is where the `llvm.set.loop.iterations` is inserted) but why would an additional/new preheader ever be needed?
> The current use case is when the existing preheader could interfere with whatever method the architecture uses for the loops. For PowerPC they don't want the mctr register being incorrectly written.
Hmm, I am not sure what exactly interfere means here so to me it sounds a bit questionable. An existing preheader should be as good as a newly created one. Maybe this is something PowerPC does in its current implementation because it makes things easier but in that case I don't think it should go into the generic framework.



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

https://reviews.llvm.org/D62604





More information about the llvm-commits mailing list