[PATCH] D62478: [LV] Wrap LV illegality reporting in a function. NFC.

Hideki Saito via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 28 10:37:51 PDT 2019

hsaito added a comment.

In D62478#1518397 <https://reviews.llvm.org/D62478#1518397>, @rengolin wrote:

> In D62478#1518099 <https://reviews.llvm.org/D62478#1518099>, @psamolysov wrote:
> > @rengolin It is because the function uses `OptimizationRemarkEmitter *ORE`, a member of the `LoopVectorizationLegality` class.
> I see. Given the function has a lot of arguments already and it really isn't used elsewhere, I'd rather just add ORE to the args list.
> Unless @hsaito or @fhahn think this could be used elsewhere in the vectorizer, then it shouldn't be in that class anyway.

@psamolysov, thanks for working on this.

Possible (and most likely recommended, if feasible) usage outside of Legal: Bail out due to cost and bail out before LV driver code hits legal (but after LV's runOnFunction() starts).
If we include those usage, emitting the message through "Legal" utility (be it member function or a utility function residing in Legal code) looks odd. Should be more like a LV level
utility. Else, what @rengolin says makes sense.

I think this is already a nice improvement. I'm fine for this patch landing as a local static function and then think about promoting this idea further into a LV level utility separately.

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list