[llvm-commits] CVS: llvm/lib/Bytecode/Reader/Reader.cpp

Reid Spencer reid at x10sys.com
Mon Jan 23 00:11:15 PST 2006



Changes in directory llvm/lib/Bytecode/Reader:

Reader.cpp updated: 1.181 -> 1.182
---
Log message:

Revert last patch because it messes up the JIT, amongst other things.


---
Diffs of the changes:  (+14 -5)

 Reader.cpp |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)


Index: llvm/lib/Bytecode/Reader/Reader.cpp
diff -u llvm/lib/Bytecode/Reader/Reader.cpp:1.181 llvm/lib/Bytecode/Reader/Reader.cpp:1.182
--- llvm/lib/Bytecode/Reader/Reader.cpp:1.181	Mon Jan 23 01:39:03 2006
+++ llvm/lib/Bytecode/Reader/Reader.cpp	Mon Jan 23 02:11:03 2006
@@ -1033,6 +1033,13 @@
 
   BB->getInstList().push_back(Result);
 
+  if (this->hasUpgradedIntrinsicFunctions && isCall)
+    if (Instruction* inst = UpgradeIntrinsicCall(cast<CallInst>(Result))) {
+      Result->replaceAllUsesWith(inst);
+      Result->eraseFromParent();
+      Result = inst;
+    }
+
   unsigned TypeSlot;
   if (Result->getType() == InstTy)
     TypeSlot = iType;
@@ -2025,6 +2032,13 @@
     Function *Func = new Function(FTy, GlobalValue::ExternalLinkage,
                                   "", TheModule);
 
+    // Replace with upgraded intrinsic function, if applicable.
+    if (Function* upgrdF = UpgradeIntrinsicFunction(Func)) {
+      hasUpgradedIntrinsicFunctions = true;
+      Func->eraseFromParent();
+      Func = upgrdF;
+    }
+
     insertValue(Func, (FnSignature & (~0U >> 1)) >> 5, ModuleValues);
 
     // Flags are not used yet.
@@ -2388,11 +2402,6 @@
     // Parse the module contents
     this->ParseModule();
 
-    // Look for intrinsic functions and CallInst that need to be upgraded
-    for (Module::iterator FI = TheModule->begin(), FE = TheModule->end();
-         FI != FE; ++FI)
-      UpgradeCallsToIntrinsic(FI);
-
     // Check for missing functions
     if (hasFunctions())
       error("Function expected, but bytecode stream ended!");






More information about the llvm-commits mailing list