[PATCH] D21739: [TTI] Add functions determining if int parameters/returns should be zeroext/signext.

Marcin Koƛcielnicki via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 29 15:03:44 PDT 2016


koriakin added a comment.

In http://reviews.llvm.org/D21739#469548, @hfinkel wrote:

> In http://reviews.llvm.org/D21739#469090, @davidxl wrote:
>
> > Looks reasonable to me. Added Hal for a second look.
>
>
> If a given target is not compiled in, then the defaults TTI provides might be wrong for the target. I think you need to add some what for the transformation to detect whether or not it is getting an accurate answer so it can abort the transformation in that case. We shouldn't miscompile IR just because we don't have a particular target available.


Right.  I will abort the InstrProfiling pass (and sanitizer passes that need this information) if the target is unknown.  There are also a few optimizations that construct library calls, but I suppose these can be safely skipped if TTI says the target is unrecognized.

I'm going to add another function to TTI, isTargetRecognized, which will return true iff the target has been found in the registry (and thus got an opportunity to supply a custom TTI, even if it didn't use it).  The default implementations of shouldExt* will assert isTargetRecognized(), and passes will need to check for it before calling shouldExt* functions (and perhaps other future queries which have to return correct information), failing or skipping optimization otherwise.  Does that sound good?


Repository:
  rL LLVM

http://reviews.llvm.org/D21739





More information about the llvm-commits mailing list