Changes in directory llvm/utils/TableGen:

IntrinsicEmitter.cpp updated: 1.4 -> 1.5
IntrinsicEmitter.h updated: 1.4 -> 1.5
---
Log message:

generate side-effect info


---
Diffs of the changes:  (+27 -0)

 IntrinsicEmitter.cpp |   25 +++++++++++++++++++++++++
 IntrinsicEmitter.h   |    2 ++
 2 files changed, 27 insertions(+)


Index: llvm/utils/TableGen/IntrinsicEmitter.cpp
diff -u llvm/utils/TableGen/IntrinsicEmitter.cpp:1.4 
llvm/utils/TableGen/IntrinsicEmitter.cpp:1.5
--- llvm/utils/TableGen/IntrinsicEmitter.cpp:1.4        Thu Mar  9 16:30:49 2006
+++ llvm/utils/TableGen/IntrinsicEmitter.cpp    Thu Mar  9 16:37:52 2006
@@ -100,6 +100,9 @@
   
   // Emit mod/ref info for each function.
   EmitModRefInfo(Ints, OS);
+  
+  // Emit side effect info for each function.
+  EmitSideEffectInfo(Ints, OS);
 }
 
 void IntrinsicEmitter::EmitEnumInfo(const std::vector<CodeGenIntrinsic> &Ints,
@@ -191,3 +194,25 @@
   }
   OS << "#endif\n\n";
 }
+
+void IntrinsicEmitter::
+EmitSideEffectInfo(const std::vector<CodeGenIntrinsic> &Ints, std::ostream 
&OS){
+  OS << "// isInstructionTriviallyDead code.\n";
+  OS << "#ifdef GET_SIDE_EFFECT_INFO\n";
+  OS << "  switch (F->getIntrinsicID()) {\n";
+  OS << "  default: break;\n";
+  for (unsigned i = 0, e = Ints.size(); i != e; ++i) {
+    switch (Ints[i].ModRef) {
+      default: break;
+      case CodeGenIntrinsic::NoMem:
+      case CodeGenIntrinsic::ReadArgMem:
+      case CodeGenIntrinsic::ReadMem:
+        OS << "  case Intrinsic::" << Ints[i].EnumName << ":\n";
+        break;
+    }
+  }
+  OS << "    return true; // These intrinsics have no side effects.\n";
+  OS << "  }\n";
+  OS << "#endif\n\n";
+  
+}


Index: llvm/utils/TableGen/IntrinsicEmitter.h
diff -u llvm/utils/TableGen/IntrinsicEmitter.h:1.4 
llvm/utils/TableGen/IntrinsicEmitter.h:1.5
--- llvm/utils/TableGen/IntrinsicEmitter.h:1.4  Thu Mar  9 16:30:49 2006
+++ llvm/utils/TableGen/IntrinsicEmitter.h      Thu Mar  9 16:37:52 2006
@@ -35,6 +35,8 @@
                       std::ostream &OS);
     void EmitModRefInfo(const std::vector<CodeGenIntrinsic> &Ints, 
                         std::ostream &OS);
+    void EmitSideEffectInfo(const std::vector<CodeGenIntrinsic> &Ints, 
+                            std::ostream &OS);
   };
 
 } // End llvm namespace



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to