[PATCH] Better account for cost of soft fp in Inliner

Cameron Esfahani dirty at apple.com
Tue Sep 17 15:43:00 PDT 2013


Nadav,
I wasn't trying to do anything that complicated.

What I'm attempting to do is determine if, in general, floating point instructions are supported natively by the target.  If they aren't, then the cost of doing floating point operations increases significantly.  The Inliner currently doesn't account for that.

You're right that having a better sense of the size of the generated instructions would help the Inliner, but I think that kind of change is beyond me...

Also, I didn't add TTI to the Inliner.  It was already being used by the CallAnalyzer engine.

Cameron Esfahani
dirty at apple.com

"We do what we must because we can."

Aperture Science



On Sep 17, 2013, at 3:24 PM, Nadav Rotem <nrotem at apple.com> wrote:

> Hi Cameron, 
> 
> In your patch you are checking for the legality of the instruction. However,  I think that what you are trying to do is to estimate the size of the generated instruction. At the moment we don’t have the infrastructure for estimating the size of instructions, but this should not be too difficult to add.
> 
> The current design decision is that early passes, such as the inliner, should not use TTI.  Only the later “lowering” passes should be able to use TTI. 
> 
> Thanks,
> Nadav 
> 
> 
> 
> On Sep 17, 2013, at 3:04 PM, Cameron Esfahani <dirty at apple.com> wrote:
> 
>> Attached is a patch and test case to better account for the cost of using floating point on systems which don't have hardware floating point in the Inliner.
>> 
>> I made a small change to TTI and I'm not 100% happy with the name of the routine I came up with: haveHWFP().  Maybe someone has a better suggestion?
>> 
>> <inline-fp.diff>
>> 
>> Cameron Esfahani
>> dirty at apple.com
>> 
>> "All that is necessary for the triumph of evil is that good men do nothing."
>> 
>> Edmund Burke
>> 
>> 
>> 
>> _______________________________________________
>> 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