[llvm-commits] [llvm] r47309 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Owen Anderson resistor at mac.com
Mon Feb 18 19:15:30 PST 2008


Author: resistor
Date: Mon Feb 18 21:15:29 2008
New Revision: 47309

URL: http://llvm.org/viewvc/llvm-project?rev=47309&view=rev
Log:
An sret parameter is required to be the first parameter, so there's no need to loop
over all the parameters of the callee looking for it.

Modified:
    llvm/trunk/lib/Transforms/Scalar/GVN.cpp

Modified: llvm/trunk/lib/Transforms/Scalar/GVN.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/GVN.cpp?rev=47309&r1=47308&r2=47309&view=diff

==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Mon Feb 18 21:15:29 2008
@@ -1089,15 +1089,10 @@
   
   // If all checks passed, then we can perform the transformation
   CallSite CS = CallSite::get(C);
-  for (unsigned i = 0; i < CS.arg_size(); ++i) {
-    if (CS.paramHasAttr(i+1, ParamAttr::StructRet)) {
-      if (CS.getArgument(i)->getType() != cpyDest->getType())
-        return false;
+  if (CS.getArgument(0)->getType() != cpyDest->getType())
+    return false;
       
-      CS.setArgument(i, cpyDest);
-      break;
-    }
-  }
+  CS.setArgument(0, cpyDest);
   
   MemoryDependenceAnalysis& MD = getAnalysis<MemoryDependenceAnalysis>();
   MD.dropInstruction(C);





More information about the llvm-commits mailing list