[llvm-commits] [llvm] r108792 - /llvm/trunk/lib/CodeGen/MachineLICM.cpp

Evan Cheng evan.cheng at apple.com
Mon Jul 19 19:01:31 PDT 2010


On Jul 19, 2010, at 5:50 PM, Dale Johannesen wrote:

> Author: johannes
> Date: Mon Jul 19 19:50:13 2010
> New Revision: 108792
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=108792&view=rev
> Log:
> Don't hoist things out of a large switch inside a
> loop, for the reasons in the comments.  This is a
> major win on 253.perlbmk on ARM Darwin.  I expect it
> to be a good heuristic in general, but it's possible
> some things will regress; I'll be watching.
> 7940152.
> 
> 
> Modified:
>    llvm/trunk/lib/CodeGen/MachineLICM.cpp
> 
> Modified: llvm/trunk/lib/CodeGen/MachineLICM.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineLICM.cpp?rev=108792&r1=108791&r2=108792&view=diff
> ==============================================================================
> --- llvm/trunk/lib/CodeGen/MachineLICM.cpp (original)
> +++ llvm/trunk/lib/CodeGen/MachineLICM.cpp Mon Jul 19 19:50:13 2010
> @@ -489,8 +489,12 @@
>   }
> 
>   const std::vector<MachineDomTreeNode*> &Children = N->getChildren();
> -  for (unsigned I = 0, E = Children.size(); I != E; ++I)
> -    HoistRegion(Children[I]);
> +  // Don't hoist things out of a large switch statement.  This often causes
> +  // code to be hoisted that wasn't going to be executed, and increases
> +  // register pressure in a situation where it's likely to matter.
> +  if (Children.size() < 10)

How would this work? This doesn't seem like a good way to determine if the loop body contains a switch statement.

Evan

> +    for (unsigned I = 0, E = Children.size(); I != E; ++I)
> +      HoistRegion(Children[I]);
> }
> 
> /// IsLICMCandidate - Returns true if the instruction may be a suitable
> 
> 
> _______________________________________________
> 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