[PATCH] D41944: [LLVM][IR][LIT] support of 'no-overflow' flag for sdiv\udiv instructions

Zvi Rackover via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 01:50:30 PST 2018


zvi added a comment.

In https://reviews.llvm.org/D41944#973480, @MatzeB wrote:

> - With the way you are modeling the new flag, means that existing bitcode/.ll files will change semantics when read with newer compilers. I'm not sure that is a good idea for this, in any way at the very least you have to provide AutoUpgrade logic for that.


This seems like a real issue. With no version info in the module, how can AutoUpgrade tell if a divide with no 'nof' attribute is of the old form or new form? This is really a performance issue, because AutoUpgrade can always pessimistically not add 'nof' if the version of the incoming module is unknown. Possible solutions:

1. Introduce versioning to LLVM IR modules - will still require to add the version info to the legacy modules, which may be unacceptable to some users.
2. Similar to above, but instead of version add a keyword or metadata key that will flag divides as upgradable to 'nof'. Same con as #1, but we can deprecate this feature sometime in the future.
3. Pass a flag that is not embedded in the module to AutoUpgrade (e.g. opt/llc will add flags that will be propagated to AutoUpgrade)




https://reviews.llvm.org/D41944





More information about the llvm-commits mailing list