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

Sam Parker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 3 06:58:19 PDT 2019


samparker marked an inline comment as done.
samparker added inline comments.


================
Comment at: include/llvm/Analysis/TargetTransformInfo.h:468
+                                          // in the loop via a phi?
+    bool RequiresNewPreheader = false;
+  };
----------------
markus wrote:
> 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.
> 
I agree. I actually removed the checks originally and will do so again. I think it is just to make it easy, but I'm not actually convinced it's required. I'm assuming that as long as set_loop_iteration is immediately followed by the terminator, there's nothing else to write CTR.


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

https://reviews.llvm.org/D62604





More information about the llvm-commits mailing list