[PATCH] D45965: [Targets] Implement getConstraintRegister for ARM and AArch64

Thomas Preud'homme via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 24 06:53:43 PDT 2018


thopre added inline comments.


================
Comment at: lib/Basic/Targets/AArch64.h:85-89
+  StringRef getConstraintRegister(StringRef Constraint,
+                                  StringRef Expression) const override {
+    return Expression;
+  }
+
----------------
miyuki wrote:
> thopre wrote:
> > From what I understood of the original patch, getConstraintRegister is a sort of a more comprehensive version of convertRegister. On ARM convertRegister handles U and p constraint specially, should this do the same?
> Did you mean `convertConstraint`? As I understand, this function does canonicalization of constraints. If a constraint happens to be single-register, it is converted into `{register}` form (but this does not happen on ARM). On the other hand, `getConstraintRegister` takes a constraint and an asm label and converts them into a register (and in our case the register always comes from the asm label, never from the constraint), so I don't think we need to handle U and p specially.
Forgot to send this:

Fair enough. Since you seems to have the expected behavior of this function well understood, would you mind adding a comment here and in clang/Basic/TargetInfo.h?

Luckily we had a similar chat offline. Thanks for the change


https://reviews.llvm.org/D45965





More information about the cfe-commits mailing list