<div dir="ltr">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.<div><br></div><div>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.</div>
<div><br></div><div><div>I am hoping to get feedback on whether or not what I'm trying to do is valid.<br></div></div><div><br></div><div>Thanks,</div><div>-Stephen</div></div>