grimar planned changes to this revision. grimar added a comment. Thanks for comments, Rui. I'll update it after https://reviews.llvm.org/D40962 be landed (I think it will be and my patch intersects with it). https://reviews.llvm.org/D40954