[PATCH] D10416: Use function attribute "arm-restrict-it"
Akira Hatanaka via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 8 13:13:57 PDT 2015
ahatanak added a comment.
In http://reviews.llvm.org/D10416#241642, @grosbach wrote:
> For the backend attribute, having -arm-restrict-it (or equivalent) transitively disable HasV8Ops is really, really bad. Those should be completely independent selections. The former is about tuning instruction selection (via if-conversion in this case) based on the microarchitecture. The latter is about which instructions are available in the first place. The former does not imply the latter.
I think we want to discuss whether the latter (HasV8Ops) implies the former (restrict-it). If it makes no sense from the user's POV to not restrict IT blocks when targeting armv8, then we can conclude armv8 implies restrict-it and add FeatureRestrictedIT to the implied features list of HasV8Ops. If we do this, disabling restrict-it would transitively disable HasV8Ops. Does that make sense?
> I don't think there's much point to disabling restrict-it when targeting v8 from an end-user POV, but it's pretty useful for the backend. We want to be able to write test cases that make sure it's working, for example.
That said, if we want to allow llvm developers to turn off restrict-it when targeting v8 for debugging purposes, we shouldn't add FeatureRestrictedIT to the implied features list of HasV8Ops.
> Do I understand right there's a frontend option, too? That's the only context in which gcc compatibility makes much sense. I don't see any value other than slavishly following gcc's option list to having this be exposed to end users in clang. I'd much rather it be entirely in the backend.
The front-end options are -mrestrict-it and -mno-restrict-it, which were committed in r194593. The clang-side patch that I submitted for review is here: http://reviews.llvm.org/D10414.
I agree that the option to disable restrict-it when targeting armv8 should be a backend option only available to llvm developers. If we all agree on that, I'll update the clang patch (http://reviews.llvm.org/D10414) accordingly.
No changes are needed to the llvm patch (this patch) to allow disabling restrict-it when targeting armv8. If -mattr=+restrict-it is not on the tool's (llc's) command line, restrict-it is disabled.
More information about the llvm-commits