[llvm-commits] [llvm] r49614 - in /llvm/trunk: lib/Linker/LinkModules.cpp lib/Transforms/Scalar/LoopRotation.cpp lib/Transforms/Scalar/LoopUnroll.cpp lib/Transforms/Scalar/TailDuplication.cpp lib/Transforms/Utils/CodeExtractor.cpp tools/bugpoint/Miscompilation.cpp
Owen Anderson
resistor at mac.com
Sun Apr 13 12:15:18 PDT 2008
Author: resistor
Date: Sun Apr 13 14:15:17 2008
New Revision: 49614
URL: http://llvm.org/viewvc/llvm-project?rev=49614&view=rev
Log:
Replace calls of the form V1->setName(V2->getName()) with V1->takeName(V2),
which is significantly more efficient.
Modified:
llvm/trunk/lib/Linker/LinkModules.cpp
llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp
llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp
llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp
llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp
llvm/trunk/tools/bugpoint/Miscompilation.cpp
Modified: llvm/trunk/lib/Linker/LinkModules.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Linker/LinkModules.cpp?rev=49614&r1=49613&r2=49614&view=diff
==============================================================================
--- llvm/trunk/lib/Linker/LinkModules.cpp (original)
+++ llvm/trunk/lib/Linker/LinkModules.cpp Sun Apr 13 14:15:17 2008
@@ -930,7 +930,7 @@
Function::arg_iterator DI = Dest->arg_begin();
for (Function::arg_iterator I = Src->arg_begin(), E = Src->arg_end();
I != E; ++I, ++DI) {
- DI->setName(I->getName()); // Copy the name information over...
+ DI->takeName(I); // Copy the name information over...
// Add a mapping to our local map
ValueMap[I] = DI;
Modified: llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp?rev=49614&r1=49613&r2=49614&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopRotation.cpp Sun Apr 13 14:15:17 2008
@@ -226,7 +226,7 @@
// If this instruction is using a value from same basic block then
// update it to use value from cloned instruction.
Instruction *C = In->clone();
- C->setName(In->getName());
+ C->takeName(In);
OrigPreHeader->getInstList().push_back(C);
for (unsigned opi = 0, e = In->getNumOperands(); opi != e; ++opi) {
Modified: llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp?rev=49614&r1=49613&r2=49614&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/LoopUnroll.cpp Sun Apr 13 14:15:17 2008
@@ -179,8 +179,8 @@
BB->eraseFromParent();
// Inherit predecessor's name if it exists...
- if (!OldName.empty() && !OnlyPred->hasName())
- OnlyPred->setName(OldName);
+ if (BB->hasName() && !OnlyPred->hasName())
+ OnlyPred->takeName(BB);
return OnlyPred;
}
Modified: llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp?rev=49614&r1=49613&r2=49614&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/TailDuplication.cpp Sun Apr 13 14:15:17 2008
@@ -317,7 +317,7 @@
//
for (; BI != DestBlock->end(); ++BI) {
Instruction *New = BI->clone();
- New->setName(BI->getName());
+ New->takeName(BI);
SourceBlock->getInstList().push_back(New);
ValueMapping[BI] = New;
}
Modified: llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp?rev=49614&r1=49613&r2=49614&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/CodeExtractor.cpp Sun Apr 13 14:15:17 2008
@@ -317,7 +317,7 @@
if (!AggregateArgs) {
AI = newFunction->arg_begin();
for (unsigned i = 0, e = inputs.size(); i != e; ++i, ++AI)
- AI->setName(inputs[i]->getName());
+ AI->takeName(inputs[i]);
for (unsigned i = 0, e = outputs.size(); i != e; ++i, ++AI)
AI->setName(outputs[i]->getName()+".out");
}
Modified: llvm/trunk/tools/bugpoint/Miscompilation.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/bugpoint/Miscompilation.cpp?rev=49614&r1=49613&r2=49614&view=diff
==============================================================================
--- llvm/trunk/tools/bugpoint/Miscompilation.cpp (original)
+++ llvm/trunk/tools/bugpoint/Miscompilation.cpp Sun Apr 13 14:15:17 2008
@@ -657,7 +657,7 @@
for (Function::arg_iterator
I = newMain->arg_begin(), E = newMain->arg_end(),
OI = oldMain->arg_begin(); I != E; ++I, ++OI) {
- I->setName(OI->getName()); // Copy argument names from oldMain
+ I->takeName(OI); // Copy argument names from oldMain
args.push_back(I);
}
More information about the llvm-commits
mailing list