projects
/
oota-llvm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Generalize some alias analysis logic from atomic
[oota-llvm.git]
/
utils
/
TableGen
/
CodeEmitterGen.cpp
diff --git
a/utils/TableGen/CodeEmitterGen.cpp
b/utils/TableGen/CodeEmitterGen.cpp
index bebf1fd56b81a230e8e9d17189ef9d41dc9b3870..ae4a6aa445b1ca0f80316202f0a61b2f0751f8e5 100644
(file)
--- a/
utils/TableGen/CodeEmitterGen.cpp
+++ b/
utils/TableGen/CodeEmitterGen.cpp
@@
-26,11
+26,14
@@
void CodeEmitterGen::reverseBits(std::vector<Record*> &Insts) {
Record *R = *I;
if (R->getName() == "PHI" ||
R->getName() == "INLINEASM" ||
Record *R = *I;
if (R->getName() == "PHI" ||
R->getName() == "INLINEASM" ||
- R->getName() == "LABEL" ||
+ R->getName() == "DBG_LABEL" ||
+ R->getName() == "EH_LABEL" ||
+ R->getName() == "GC_LABEL" ||
R->getName() == "DECLARE" ||
R->getName() == "EXTRACT_SUBREG" ||
R->getName() == "INSERT_SUBREG" ||
R->getName() == "DECLARE" ||
R->getName() == "EXTRACT_SUBREG" ||
R->getName() == "INSERT_SUBREG" ||
- R->getName() == "IMPLICIT_DEF") continue;
+ R->getName() == "IMPLICIT_DEF" ||
+ R->getName() == "SUBREG_TO_REG") continue;
BitsInit *BI = R->getValueAsBitsInit("Inst");
BitsInit *BI = R->getValueAsBitsInit("Inst");
@@
-86,7
+89,7
@@
void CodeEmitterGen::run(std::ostream &o) {
// Emit function declaration
o << "unsigned " << Target.getName() << "CodeEmitter::"
// Emit function declaration
o << "unsigned " << Target.getName() << "CodeEmitter::"
- << "getBinaryCodeForInstr(MachineInstr &MI) {\n";
+ << "getBinaryCodeForInstr(
const
MachineInstr &MI) {\n";
// Emit instruction base values
o << " static const unsigned InstBits[] = {\n";
// Emit instruction base values
o << " static const unsigned InstBits[] = {\n";
@@
-97,16
+100,17
@@
void CodeEmitterGen::run(std::ostream &o) {
const CodeGenInstruction *CGI = *IN;
Record *R = CGI->TheDef;
const CodeGenInstruction *CGI = *IN;
Record *R = CGI->TheDef;
- if (IN != NumberedInstructions.begin()) o << ",\n";
-
if (R->getName() == "PHI" ||
R->getName() == "INLINEASM" ||
if (R->getName() == "PHI" ||
R->getName() == "INLINEASM" ||
- R->getName() == "LABEL" ||
+ R->getName() == "DBG_LABEL" ||
+ R->getName() == "EH_LABEL" ||
+ R->getName() == "GC_LABEL" ||
R->getName() == "DECLARE" ||
R->getName() == "EXTRACT_SUBREG" ||
R->getName() == "INSERT_SUBREG" ||
R->getName() == "DECLARE" ||
R->getName() == "EXTRACT_SUBREG" ||
R->getName() == "INSERT_SUBREG" ||
- R->getName() == "IMPLICIT_DEF") {
- o << " 0U";
+ R->getName() == "IMPLICIT_DEF" ||
+ R->getName() == "SUBREG_TO_REG") {
+ o << " 0U,\n";
continue;
}
continue;
}
@@
-119,9
+123,9
@@
void CodeEmitterGen::run(std::ostream &o) {
Value |= B->getValue() << (e-i-1);
}
}
Value |= B->getValue() << (e-i-1);
}
}
- o << " " << Value << "U";
+ o << " " << Value << "U
," << '\t' << "// " << R->getName() << "\n
";
}
}
- o << "\n };\n";
+ o << "
0U
\n };\n";
// Map to accumulate all the cases.
std::map<std::string, std::vector<std::string> > CaseMap;
// Map to accumulate all the cases.
std::map<std::string, std::vector<std::string> > CaseMap;
@@
-135,11
+139,14
@@
void CodeEmitterGen::run(std::ostream &o) {
if (InstName == "PHI" ||
InstName == "INLINEASM" ||
if (InstName == "PHI" ||
InstName == "INLINEASM" ||
- InstName == "LABEL"||
+ InstName == "DBG_LABEL"||
+ InstName == "EH_LABEL"||
+ InstName == "GC_LABEL"||
InstName == "DECLARE"||
InstName == "EXTRACT_SUBREG" ||
InstName == "INSERT_SUBREG" ||
InstName == "DECLARE"||
InstName == "EXTRACT_SUBREG" ||
InstName == "INSERT_SUBREG" ||
- InstName == "IMPLICIT_DEF") continue;
+ InstName == "IMPLICIT_DEF" ||
+ InstName == "SUBREG_TO_REG") continue;
BitsInit *BI = R->getValueAsBitsInit("Inst");
const std::vector<RecordVal> &Vals = R->getValues();
BitsInit *BI = R->getValueAsBitsInit("Inst");
const std::vector<RecordVal> &Vals = R->getValues();
@@
-184,7
+191,7
@@
void CodeEmitterGen::run(std::ostream &o) {
gotOp = true;
}
gotOp = true;
}
- unsigned opMask =
(1 << N) - 1
;
+ unsigned opMask =
~0U >> (32-N)
;
int opShift = beginVarBit - N + 1;
opMask <<= opShift;
opShift = beginInstBit - beginVarBit;
int opShift = beginVarBit - N + 1;
opMask <<= opShift;
opShift = beginInstBit - beginVarBit;
@@
-211,7
+218,8
@@
void CodeEmitterGen::run(std::ostream &o) {
// Emit initial function code
o << " const unsigned opcode = MI.getOpcode();\n"
<< " unsigned Value = InstBits[opcode];\n"
// Emit initial function code
o << " const unsigned opcode = MI.getOpcode();\n"
<< " unsigned Value = InstBits[opcode];\n"
- << " unsigned op;\n"
+ << " unsigned op = 0;\n"
+ << " op = op; // suppress warning\n"
<< " switch (opcode) {\n";
// Emit each case statement
<< " switch (opcode) {\n";
// Emit each case statement