extract some more information from the intrinsic table

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27022 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-03-24 01:13:55 +00:00
parent 1c070fc10b
commit 7056de375d
2 changed files with 25 additions and 1 deletions

View File

@ -124,7 +124,10 @@ void IntrinsicEmitter::run(std::ostream &OS) {
// Emit mod/ref info for each function.
EmitModRefInfo(Ints, OS);
// Emit side effect info for each function.
// Emit table of non-memory accessing intrinsics.
EmitNoMemoryInfo(Ints, OS);
// Emit side effect info for each intrinsic.
EmitSideEffectInfo(Ints, OS);
// Emit a list of intrinsics with corresponding GCC builtins.
@ -253,6 +256,25 @@ void IntrinsicEmitter::EmitModRefInfo(const std::vector<CodeGenIntrinsic> &Ints,
OS << "#endif\n\n";
}
void IntrinsicEmitter::
EmitNoMemoryInfo(const std::vector<CodeGenIntrinsic> &Ints, std::ostream &OS) {
OS << "// SelectionDAGIsel code.\n";
OS << "#ifdef GET_NO_MEMORY_INTRINSICS\n";
OS << " switch (IntrinsicID) {\n";
OS << " default: break;\n";
for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
switch (Ints[i].ModRef) {
default: break;
case CodeGenIntrinsic::NoMem:
OS << " case Intrinsic::" << Ints[i].EnumName << ":\n";
break;
}
}
OS << " return true; // These intrinsics have no side effects.\n";
OS << " }\n";
OS << "#endif\n\n";
}
void IntrinsicEmitter::
EmitSideEffectInfo(const std::vector<CodeGenIntrinsic> &Ints, std::ostream &OS){
OS << "// isInstructionTriviallyDead code.\n";

View File

@ -37,6 +37,8 @@ namespace llvm {
std::ostream &OS);
void EmitModRefInfo(const std::vector<CodeGenIntrinsic> &Ints,
std::ostream &OS);
void EmitNoMemoryInfo(const std::vector<CodeGenIntrinsic> &Ints,
std::ostream &OS);
void EmitSideEffectInfo(const std::vector<CodeGenIntrinsic> &Ints,
std::ostream &OS);
void EmitGCCBuiltinList(const std::vector<CodeGenIntrinsic> &Ints,