[PATCH] D49281: [Unroll/UnrollAndJam/Vectorizer/Distribute] Add followup loop attributes.

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 07:49:24 PST 2018


hfinkel added inline comments.


================
Comment at: lib/Transforms/Scalar/WarnMissedTransforms.cpp:32
+                                          L->getStartLoc(), L->getHeader())
+        << "loop not unrolled: failed explicitly specified loop unrolling");
+  }
----------------
Meinersbur wrote:
> hfinkel wrote:
> > Here and below, explicitly specified should have a hyphen (it is a compound adjective):
> > 
> >   explicitly-specified loop unrolling
> > 
> > that having been said, I'd prefer a different phrasing all together. These are end-user visible messages, and I think that we can make these slightly more user friendly. How about this:
> > 
> >   
> >   "loop not unrolled: the optimizer was unable to perform the requested transformation"
> > 
> > (and similar for the others)
> I think that "the optimizer was unable to perform" is less accurate: it gives the impression that the optimizer actually tried to perform the transformation, but one of the reasons the metadata is still present is that the corresponding pass is not in the pipeline (e.g. because of `-fno-vectorize` or `-mllvm -enable-unroll-and-jam` is missing). That is, the user should modify the compiler flags instead of tweaking the source code.
> 
> That being said, "failed to ..." is not much better. Any better suggestions?
> I think that "the optimizer was unable to perform" is less accurate: ... but one of the reasons the metadata is still present is that the corresponding pass is not in the pipeline...

I disagree that it is less accurate, and the optimizer might be unable to perform an optimization for structural reasons, and to say that something "failed" clearly implies to me that it was explicitly attempted (which in this case it was not). Nevertheless, this is a good point, and we could provide a more-useful message. How about this:

  loop not unrolled: the optimizer was unable to perform the requested transformation; the transformation might be disabled or specified as part of an unsupported transformation ordering






Repository:
  rL LLVM

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

https://reviews.llvm.org/D49281





More information about the llvm-commits mailing list