[PATCH] D63686: [LFTR] Fix post-inc pointer IV with truncated exit count (PR41998)

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 28 14:14:37 PDT 2019


reames added a comment.

I'm hesitant about this.  Not because your patch is wrong, but because we've ended up with a ton of complexity involving the post-increment case.  I'd really like to take a step back and see if we can factor apart some code here.

Assume for the moment that we have a transform which knows how to generate the pre-increment form, can we do post increment conversion as a post processing step?

If we were willing to strip, I think we could just strip flags and add one to both sides of the comparison *in whatever bitwidth the pre-inc form chose*.  Do you agree?

If so, then I think we can move the post-inc legality/stripping entirely into a separate transform which runs *after* we've formed the arguments for the new comparison.  (Which is slightly different than the current patch as we'd do the pre-to-post *after* the extend/trunc decision.)

I'm also really questioning the value of doing pre-to-post conversion in the middle end at all.  I'm getting increasing tempted to move that to just before codegen, and just strip all the flags without concern.  :)


Repository:
  rL LLVM

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

https://reviews.llvm.org/D63686





More information about the llvm-commits mailing list