[llvm-branch-commits] [llvm-branch] r100916 - in /llvm/branches/ggreif/CallInst-operands/lib: CodeGen/IntrinsicLowering.cpp Transforms/IPO/LowerSetJmp.cpp Transforms/Scalar/SCCVN.cpp Transforms/Utils/InlineFunction.cpp

Gabor Greif ggreif at gmail.com
Fri Apr 9 19:15:45 PDT 2010


Author: ggreif
Date: Fri Apr  9 21:15:45 2010
New Revision: 100916

URL: http://llvm.org/viewvc/llvm-project?rev=100916&view=rev
Log:
shift some operand ranges

Modified:
    llvm/branches/ggreif/CallInst-operands/lib/CodeGen/IntrinsicLowering.cpp
    llvm/branches/ggreif/CallInst-operands/lib/Transforms/IPO/LowerSetJmp.cpp
    llvm/branches/ggreif/CallInst-operands/lib/Transforms/Scalar/SCCVN.cpp
    llvm/branches/ggreif/CallInst-operands/lib/Transforms/Utils/InlineFunction.cpp

Modified: llvm/branches/ggreif/CallInst-operands/lib/CodeGen/IntrinsicLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/CallInst-operands/lib/CodeGen/IntrinsicLowering.cpp?rev=100916&r1=100915&r2=100916&view=diff
==============================================================================
--- llvm/branches/ggreif/CallInst-operands/lib/CodeGen/IntrinsicLowering.cpp (original)
+++ llvm/branches/ggreif/CallInst-operands/lib/CodeGen/IntrinsicLowering.cpp Fri Apr  9 21:15:45 2010
@@ -311,17 +311,17 @@
   switch (CI->getOperand(0)->getType()->getTypeID()) {
   default: llvm_unreachable("Invalid type in intrinsic");
   case Type::FloatTyID:
-    ReplaceCallWith(Fname, CI, CI->op_begin() + 1, CI->op_end(),
+    ReplaceCallWith(Fname, CI, CI->op_begin(), CI->op_end() - 1,
                   Type::getFloatTy(CI->getContext()));
     break;
   case Type::DoubleTyID:
-    ReplaceCallWith(Dname, CI, CI->op_begin() + 1, CI->op_end(),
+    ReplaceCallWith(Dname, CI, CI->op_begin(), CI->op_end() - 1,
                   Type::getDoubleTy(CI->getContext()));
     break;
   case Type::X86_FP80TyID:
   case Type::FP128TyID:
   case Type::PPC_FP128TyID:
-    ReplaceCallWith(LDname, CI, CI->op_begin() + 1, CI->op_end(),
+    ReplaceCallWith(LDname, CI, CI->op_begin(), CI->op_end() - 1,
                   CI->getOperand(0)->getType());
     break;
   }
@@ -347,7 +347,7 @@
     // by the lowerinvoke pass.  In both cases, the right thing to do is to
     // convert the call to an explicit setjmp or longjmp call.
   case Intrinsic::setjmp: {
-    Value *V = ReplaceCallWith("setjmp", CI, CI->op_begin() + 1, CI->op_end(),
+    Value *V = ReplaceCallWith("setjmp", CI, CI->op_begin(), CI->op_end() - 1,
                                Type::getInt32Ty(Context));
     if (!CI->getType()->isVoidTy())
       CI->replaceAllUsesWith(V);
@@ -359,7 +359,7 @@
      break;
 
   case Intrinsic::longjmp: {
-    ReplaceCallWith("longjmp", CI, CI->op_begin() + 1, CI->op_end(),
+    ReplaceCallWith("longjmp", CI, CI->op_begin(), CI->op_end() - 1,
                     Type::getVoidTy(Context));
     break;
   }

Modified: llvm/branches/ggreif/CallInst-operands/lib/Transforms/IPO/LowerSetJmp.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/CallInst-operands/lib/Transforms/IPO/LowerSetJmp.cpp?rev=100916&r1=100915&r2=100916&view=diff
==============================================================================
--- llvm/branches/ggreif/CallInst-operands/lib/Transforms/IPO/LowerSetJmp.cpp (original)
+++ llvm/branches/ggreif/CallInst-operands/lib/Transforms/IPO/LowerSetJmp.cpp Fri Apr  9 21:15:45 2010
@@ -473,7 +473,7 @@
 
   // Construct the new "invoke" instruction.
   TerminatorInst* Term = OldBB->getTerminator();
-  std::vector<Value*> Params(CI.op_begin() + 1, CI.op_end());
+  std::vector<Value*> Params(CI.op_begin(), CI.op_end() - 1);
   InvokeInst* II =
     InvokeInst::Create(CI.getCalledValue(), NewBB, PrelimBBMap[Func],
                        Params.begin(), Params.end(), CI.getName(), Term);

Modified: llvm/branches/ggreif/CallInst-operands/lib/Transforms/Scalar/SCCVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/CallInst-operands/lib/Transforms/Scalar/SCCVN.cpp?rev=100916&r1=100915&r2=100916&view=diff
==============================================================================
--- llvm/branches/ggreif/CallInst-operands/lib/Transforms/Scalar/SCCVN.cpp (original)
+++ llvm/branches/ggreif/CallInst-operands/lib/Transforms/Scalar/SCCVN.cpp Fri Apr  9 21:15:45 2010
@@ -244,14 +244,14 @@
   }
 }
 
-Expression ValueTable::create_expression(CallInst* C) {
+Expression ValueTable::create_expression(CallInst* CI) {
   Expression e;
 
-  e.type = C->getType();
+  e.type = CI->getType();
   e.opcode = Expression::CALL;
 
-  e.varargs.push_back(lookup(C->getCalledFunction()));
-  for (CallInst::op_iterator I = C->op_begin()+1, E = C->op_end();
+  e.varargs.push_back(lookup(CI->getCalledFunction()));
+  for (CallInst::op_iterator I = CI->op_begin(), E = CI->op_end() - 1;
        I != E; ++I)
     e.varargs.push_back(lookup(*I));
 

Modified: llvm/branches/ggreif/CallInst-operands/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/ggreif/CallInst-operands/lib/Transforms/Utils/InlineFunction.cpp?rev=100916&r1=100915&r2=100916&view=diff
==============================================================================
--- llvm/branches/ggreif/CallInst-operands/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/branches/ggreif/CallInst-operands/lib/Transforms/Utils/InlineFunction.cpp Fri Apr  9 21:15:45 2010
@@ -66,7 +66,7 @@
     
     // Next, create the new invoke instruction, inserting it at the end
     // of the old basic block.
-    SmallVector<Value*, 8> InvokeArgs(CI->op_begin()+1, CI->op_end());
+    SmallVector<Value*, 8> InvokeArgs(CI->op_begin(), CI->op_end() - 1);
     InvokeInst *II =
       InvokeInst::Create(CI->getCalledValue(), Split, InvokeDest,
                          InvokeArgs.begin(), InvokeArgs.end(),





More information about the llvm-branch-commits mailing list