From: Igor Laevsky Date: Thu, 22 Oct 2015 18:35:34 +0000 (+0000) Subject: [IntrinsicEmitter] Remove GET_INTRINSIC_MODREF_BEHAVIOR table X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=a4e4343a262b95189136baa35053a33e5ff54f18;p=oota-llvm.git [IntrinsicEmitter] Remove GET_INTRINSIC_MODREF_BEHAVIOR table There is no need to generate separate table for intrinsics mod ref behaviour. It can now be determined purely from function attributes. Differential Revision: http://reviews.llvm.org/D13917 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251040 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/utils/TableGen/IntrinsicEmitter.cpp b/utils/TableGen/IntrinsicEmitter.cpp index 9ec39340e3f..2d2b97ddf87 100644 --- a/utils/TableGen/IntrinsicEmitter.cpp +++ b/utils/TableGen/IntrinsicEmitter.cpp @@ -50,8 +50,6 @@ public: raw_ostream &OS); void EmitAttributes(const std::vector &Ints, raw_ostream &OS); - void EmitModRefBehavior(const std::vector &Ints, - raw_ostream &OS); void EmitIntrinsicToGCCBuiltinMap(const std::vector &Ints, raw_ostream &OS); void EmitIntrinsicToMSBuiltinMap(const std::vector &Ints, @@ -92,9 +90,6 @@ void IntrinsicEmitter::run(raw_ostream &OS) { // Emit the intrinsic parameter attributes. EmitAttributes(Ints, OS); - // Emit intrinsic alias analysis mod/ref behavior. - EmitModRefBehavior(Ints, OS); - // Emit code to translate GCC builtins into LLVM intrinsics. EmitIntrinsicToGCCBuiltinMap(Ints, OS); @@ -705,42 +700,6 @@ EmitAttributes(const std::vector &Ints, raw_ostream &OS) { OS << "#endif // GET_INTRINSIC_ATTRIBUTES\n\n"; } -/// EmitModRefBehavior - Determine intrinsic alias analysis mod/ref behavior. -void IntrinsicEmitter:: -EmitModRefBehavior(const std::vector &Ints, raw_ostream &OS){ - OS << "// Determine intrinsic alias analysis mod/ref behavior.\n" - << "#ifdef GET_INTRINSIC_MODREF_BEHAVIOR\n" - << "assert(iid <= Intrinsic::" << Ints.back().EnumName << " && " - << "\"Unknown intrinsic.\");\n\n"; - - OS << "static const uint8_t IntrinsicModRefBehavior[] = {\n" - << " /* invalid */ FMRB_UnknownModRefBehavior,\n"; - for (unsigned i = 0, e = Ints.size(); i != e; ++i) { - OS << " /* " << TargetPrefix << Ints[i].EnumName << " */ "; - switch (Ints[i].ModRef) { - case CodeGenIntrinsic::NoMem: - OS << "FMRB_DoesNotAccessMemory,\n"; - break; - case CodeGenIntrinsic::ReadArgMem: - OS << "FMRB_OnlyReadsArgumentPointees,\n"; - break; - case CodeGenIntrinsic::ReadMem: - OS << "FMRB_OnlyReadsMemory,\n"; - break; - case CodeGenIntrinsic::ReadWriteArgMem: - OS << "FMRB_OnlyAccessesArgumentPointees,\n"; - break; - case CodeGenIntrinsic::ReadWriteMem: - OS << "FMRB_UnknownModRefBehavior,\n"; - break; - } - } - OS << "};\n\n" - << "return " - "static_cast(IntrinsicModRefBehavior[iid]);\n" - << "#endif // GET_INTRINSIC_MODREF_BEHAVIOR\n\n"; -} - /// EmitTargetBuiltins - All of the builtins in the specified map are for the /// same target, and we already checked it. static void EmitTargetBuiltins(const std::map &BIM,