[PATCH] D37374: [PATCH][ARM] Enable the use of SVC anywhere in an IT block
Peter Smith via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 1 03:17:08 PDT 2017
peter.smith added a comment.
Will be worth uploading the diff again with context git diff -U999999.
================
Comment at: lib/Target/ARM/AsmParser/ARMAsmParser.cpp:8725
+
+ if (Inst.getOpcode() == ARM::tSVC)
+ return false;
----------------
My guess is that this is here because tSVC sets isCall but in the Arm ARM it is classified as an exception, and isn't marked as "not permitted in IT block" or "Outside or last in IT block". Exceptions are permitted to return to an IT block as long as they preserve the condition codes.
I've a couple of thoughts; the first would be to make this clearer by adding a comment along the lines of isCall is true for SVC, but it is not an IT block terminator. The other would be to move the test into the if statement, for example (MCID.isCall() && Inst.getOpcode() == ARM::tSVC).
The other thought I've not got a good answer for, does tSVC really need to set isCall given that an SVC is an exception rather than a call and must be implemented as if it were an exception (save all registers, stack, condition codes etc.).
https://reviews.llvm.org/D37374
More information about the llvm-commits
mailing list