Skip to content

Commit

Permalink
[hexagon] Distinguish the 'o', 'v', and 'm' inline assembly memory co…
Browse files Browse the repository at this point in the history
…nstraints.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232374 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
dsandersllvm committed Mar 16, 2015
1 parent 6d9e62f commit 6ea2c6d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions include/llvm/IR/InlineAsm.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,8 @@ class InlineAsm : public Value {
// constraint codes for all targets.
Constraint_Unknown = 0,
Constraint_m,
Constraint_o, // Unused at the moment since Constraint_m is always used.
Constraint_v, // Unused at the moment since Constraint_m is always used.
Constraint_o,
Constraint_v,
Constraints_Max = Constraint_v,
Constraints_ShiftAmount = 16,

Expand Down
6 changes: 3 additions & 3 deletions lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1108,11 +1108,11 @@ 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_o: // Offsetable.
case InlineAsm::Constraint_v: // Not offsetable.
case InlineAsm::Constraint_m: // Memory.
if (SelectAddrFI(Inp, Res))
OutOps.push_back(Res);
else
Expand Down
7 changes: 5 additions & 2 deletions lib/Target/Hexagon/HexagonISelLowering.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6ea2c6d

Please sign in to comment.