[PATCH] D62656: Make SwitchInstProfUpdateWrapper safer

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 31 00:03:42 PDT 2019


nikic added a comment.

@davidxl I believe the changes here are only temporary until D61179 <https://reviews.llvm.org/D61179> lands, which will enforce this at the verifier level. As such I don't think there's much value in introducing a verification option here, because this is not really the right place to do that.

What I would suggest though is to maybe drop the branch weight metadata entirely if it's not valid. I think it's pretty weird (as was commented above) that you might end up with "valid" metadata after performing additional transformations (removing/adding cases), but that metadata will just be an accidental assignment, more or less. I think it would be better to discard it wholesale than risk an incorrect reinterpretation.


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

https://reviews.llvm.org/D62656





More information about the llvm-commits mailing list