summaryrefslogtreecommitdiffstats
path: root/llvm/utils
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2005-12-26 09:11:45 +0000
committerEvan Cheng <evan.cheng@apple.com>2005-12-26 09:11:45 +0000
commit14c53b45f5bdbb11ce13ec7784afdfa9091cdce4 (patch)
tree7d451ccd7d994d12b188ceed688056654a7c4f56 /llvm/utils
parent357a3ecbdc399ecc82ac74700e09cf739851cd2f (diff)
downloadbcm5719-llvm-14c53b45f5bdbb11ce13ec7784afdfa9091cdce4.tar.gz
bcm5719-llvm-14c53b45f5bdbb11ce13ec7784afdfa9091cdce4.zip
Added field noResults to Instruction.
Currently tblgen cannot tell which operands in the operand list are results so it assumes the first one is a result. This is bad. Ideally we would fix this by separating results from inputs, e.g. (res R32:$dst), (ops R32:$src1, R32:$src2). But that's a more distruptive change. Adding 'let noResults = 1' is the workaround to tell tblgen that the instruction does not produces a result. It works for now since tblgen does not support instructions which produce multiple results. llvm-svn: 25017
Diffstat (limited to 'llvm/utils')
-rw-r--r--llvm/utils/TableGen/CodeGenInstruction.h1
-rw-r--r--llvm/utils/TableGen/CodeGenTarget.cpp1
-rw-r--r--llvm/utils/TableGen/DAGISelEmitter.cpp5
3 files changed, 3 insertions, 4 deletions
diff --git a/llvm/utils/TableGen/CodeGenInstruction.h b/llvm/utils/TableGen/CodeGenInstruction.h
index 703da46804e..b76d3b98694 100644
--- a/llvm/utils/TableGen/CodeGenInstruction.h
+++ b/llvm/utils/TableGen/CodeGenInstruction.h
@@ -87,6 +87,7 @@ namespace llvm {
bool hasCtrlDep;
bool hasInFlag;
bool hasOutFlag;
+ bool noResults;
CodeGenInstruction(Record *R, const std::string &AsmStr);
diff --git a/llvm/utils/TableGen/CodeGenTarget.cpp b/llvm/utils/TableGen/CodeGenTarget.cpp
index b6ddd6285c3..25d01fc0553 100644
--- a/llvm/utils/TableGen/CodeGenTarget.cpp
+++ b/llvm/utils/TableGen/CodeGenTarget.cpp
@@ -273,6 +273,7 @@ CodeGenInstruction::CodeGenInstruction(Record *R, const std::string &AsmStr)
hasCtrlDep = R->getValueAsBit("hasCtrlDep");
hasInFlag = R->getValueAsBit("hasInFlag");
hasOutFlag = R->getValueAsBit("hasOutFlag");
+ noResults = R->getValueAsBit("noResults");
hasVariableNumberOfOperands = false;
DagInit *DI;
diff --git a/llvm/utils/TableGen/DAGISelEmitter.cpp b/llvm/utils/TableGen/DAGISelEmitter.cpp
index 8754097d904..85ebfdece9a 100644
--- a/llvm/utils/TableGen/DAGISelEmitter.cpp
+++ b/llvm/utils/TableGen/DAGISelEmitter.cpp
@@ -1097,11 +1097,8 @@ void DAGISelEmitter::ParseInstructions() {
CodeGenInstruction &InstInfo =Target.getInstruction(Instrs[i]->getName());
if (InstInfo.OperandList.size() != 0) {
- // It's possible for some instruction, e.g. RET for X86 that only has an
- // implicit flag operand.
// FIXME: temporary hack...
- if (InstInfo.isReturn || InstInfo.isBranch || InstInfo.isCall ||
- InstInfo.isStore) {
+ if (InstInfo.noResults) {
// These produce no results
for (unsigned j = 0, e = InstInfo.OperandList.size(); j < e; ++j)
Operands.push_back(InstInfo.OperandList[j].Rec);
OpenPOWER on IntegriCloud