Simplify GEP's and Load's in InlineCost

Stephen Schiffli sschiffli at gmail.com
Mon Sep 16 15:50:18 PDT 2013


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.

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130916/9a3ff76a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: InlineCost.diff
Type: application/octet-stream
Size: 9657 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130916/9a3ff76a/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test.ll
Type: application/octet-stream
Size: 3758 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130916/9a3ff76a/attachment-0001.obj>


More information about the llvm-commits mailing list