Re-commit: [hexagon] Distinguish the 'o', 'v', and 'm' inline assembly memory constra...
authorDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 17 Mar 2015 14:37:39 +0000 (14:37 +0000)
committerDaniel Sanders <daniel.sanders@imgtec.com>
Tue, 17 Mar 2015 14:37:39 +0000 (14:37 +0000)
Summary:
But still handle them the same way since I don't know how they differ on
this target.

No functional change intended.

Reviewers: kparzysz, adasgupt

Reviewed By: kparzysz, adasgupt

Subscribers: colinl, llvm-commits

Differential Revision: http://reviews.llvm.org/D8204

Like for the PowerPC target, I've had to add 'i' to the constraint mappings in
order to pass 2007-12-17-InvokeAsm.ll. It's not clear why 'i' has historically
been treated as a memory constraint.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232480 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/IR/InlineAsm.h
lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
lib/Target/Hexagon/HexagonISelLowering.h

index a1d72a4af73386257c24e42400314b20a153f577..bdb75dbc5b24937dec21585669882e441130e576 100644 (file)
@@ -243,7 +243,7 @@ public:
     Constraint_i,
     Constraint_m,
     Constraint_o,
-    Constraint_v, // Unused at the moment since Constraint_m is always used.
+    Constraint_v,
     Constraint_Q,
     Constraint_Z,
     Constraint_Zy,
index 795faf97af474a297830dfbdd5fe53ffd4846d13..33c4ce51aac12c78ae8537fec134861bcfe3ae34 100644 (file)
@@ -1108,11 +1108,12 @@ SelectInlineAsmMemoryOperand(const SDValue &Op, unsigned ConstraintID,
   SDValue Inp = Op, Res;
 
   switch (ConstraintID) {
-  case InlineAsm::Constraint_o:   // Offsetable.
-  case InlineAsm::Constraint_v:   // Not offsetable.
   default:
     return true;
-  case InlineAsm::Constraint_m:   // Memory.
+  case InlineAsm::Constraint_i:
+  case InlineAsm::Constraint_o: // Offsetable.
+  case InlineAsm::Constraint_v: // Not offsetable.
+  case InlineAsm::Constraint_m: // Memory.
     if (SelectAddrFI(Inp, Res))
       OutOps.push_back(Res);
     else
index 7b772f07eb059c66019579f7ce51811fa92b2022..99214c8d4452de1050824b186cb9984c214c956a 100644 (file)
@@ -185,8 +185,11 @@ bool isPositiveHalfWord(SDNode *N);
 
     unsigned getInlineAsmMemConstraint(
         const std::string &ConstraintCode) const override {
-      // FIXME: Map different constraints differently.
-      return InlineAsm::Constraint_m;
+      if (ConstraintCode == "o")
+        return InlineAsm::Constraint_o;
+      else if (ConstraintCode == "v")
+        return InlineAsm::Constraint_v;
+      return TargetLowering::getInlineAsmMemConstraint(ConstraintCode);
     }
 
     // Intrinsics