From e6a8522990cda75be33ea31260e0beb7a65c0b41 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 24 Mar 2006 01:13:55 +0000 Subject: [PATCH] extract some more information from the intrinsic table llvm-svn: 27022 --- utils/TableGen/IntrinsicEmitter.cpp | 24 +++++++++++++++++++++++- utils/TableGen/IntrinsicEmitter.h | 2 ++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/utils/TableGen/IntrinsicEmitter.cpp b/utils/TableGen/IntrinsicEmitter.cpp index 4c739e9b3a6..c56e9507c03 100644 --- a/utils/TableGen/IntrinsicEmitter.cpp +++ b/utils/TableGen/IntrinsicEmitter.cpp @@ -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 &Ints, OS << "#endif\n\n"; } +void IntrinsicEmitter:: +EmitNoMemoryInfo(const std::vector &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 &Ints, std::ostream &OS){ OS << "// isInstructionTriviallyDead code.\n"; diff --git a/utils/TableGen/IntrinsicEmitter.h b/utils/TableGen/IntrinsicEmitter.h index fa7cf7ca0f6..ff97b4fe116 100644 --- a/utils/TableGen/IntrinsicEmitter.h +++ b/utils/TableGen/IntrinsicEmitter.h @@ -37,6 +37,8 @@ namespace llvm { std::ostream &OS); void EmitModRefInfo(const std::vector &Ints, std::ostream &OS); + void EmitNoMemoryInfo(const std::vector &Ints, + std::ostream &OS); void EmitSideEffectInfo(const std::vector &Ints, std::ostream &OS); void EmitGCCBuiltinList(const std::vector &Ints,