Simplify GEP's and Load's in InlineCost

Duncan Sands duncan.sands at
Tue Sep 17 05:46:34 PDT 2013

Hi Stephen,

On 17/09/13 00:50, Stephen Schiffli wrote:
> Attached is a patch which attempts to simplify loads and GEPs when calculating
> inline cost.  Also attached is an example of the situation I ran into which
> motivated this work.

the example seems to have gotten lost.

Ciao, Duncan.

> In my specific case, I ended up with many constant structures and some functions
> which take these constants as parameters.  These function do a switch based on
> some piece of date in the structure.  Currently when calculating cost we must
> add the cost of all the blocks since it can't determine the destination of the
> switch.  However if we simplify the loads and GEPs we can figure out the
> destination block of the switch and thus only count a single block in the switch.
> I am hoping to get feedback on whether or not what I'm trying to do is valid.
> Thanks,
> -Stephen
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at

More information about the llvm-commits mailing list