[llvm-commits] [llvm] r60393 - /llvm/trunk/lib/Transforms/Scalar/GVN.cpp
Chris Lattner
clattner at apple.com
Mon Dec 1 20:12:12 PST 2008
On Dec 1, 2008, at 8:09 PM, Owen Anderson wrote:
> Author: resistor
> Date: Mon Dec 1 22:09:22 2008
> New Revision: 60393
>
> URL: http://llvm.org/viewvc/llvm-project?rev=60393&view=rev
> Log:
> Fix an issue that Chris noticed, where local PRE was not properly
> instantiating
> a new value numbering set after splitting a critical edge. This
> increases
> the number of instances of PRE on 403.gcc from ~60 to ~570.
Thanks Owen, but testcase please! We don't have enough feature tests
for GVN, please help fix!
-Chris
>
>
> 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=60393&r1=60392&r2=60393&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Transforms/Scalar/GVN.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/GVN.cpp Mon Dec 1 22:09:22 2008
> @@ -1299,6 +1299,7 @@
>
> if (isCriticalEdge(PREPred->getTerminator(), succNum)) {
> toSplit.push_back(std::make_pair(PREPred->getTerminator(),
> succNum));
> + Changed = true;
> continue;
> }
>
> @@ -1361,10 +1362,14 @@
> }
>
> for (SmallVector<std::pair<TerminatorInst*, unsigned>, 4>::iterator
> - I = toSplit.begin(), E = toSplit.end(); I != E; ++I)
> + I = toSplit.begin(), E = toSplit.end(); I != E; ++I) {
> SplitCriticalEdge(I->first, I->second, this);
> + BasicBlock* NewBlock = I->first->getSuccessor(I->second);
> + localAvail[NewBlock] =
> + new ValueNumberScope(localAvail[I->first->getParent()]);
> + }
>
> - return Changed || toSplit.size();
> + return Changed;
> }
>
> // iterateOnFunction - Executes one iteration of GVN
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list