LoopSink pass shares the same canSinkOrHoistInst functionality with LICM pass. This patch exposes this function in preparation of https://reviews.llvm.org/D22778
As with the other patch, please avoid submitting without review after you ask folks to do the review...
Generally, I don't know that it makes sense to split this one out (and I tried to make that clear in the other thread). This is now a public function without any other users, which we try to avoid. Anyways, I would have avoided splitting this one out... Anyways, more a note for the future. I don't think there are really substantive changes needed here.
That said, I *did* have some comments about this part of the change that I hadn't made yet... Again, this is minor stuff, but stuff that indicates the change might not be across the "obvious" bar yet.
Please use the modern doxygen format for this comment.
Unrelated and really minor nit pick: I also would suggest using the indicative mood rather than the imperative for API level comments although this isn't super important. The difference would be "Returns true ..." rather than "Return true ...".
Please don't leave a duplicate doxygen comment for this API when adding a declaration in a header with its own comment. They have a tendancy to grow stale.
In fact, I'll point out that it is *already stale*.