[PATCH] Avoid FP conversions when calling bitcasted / alias functions

Eli Friedman eli.friedman at gmail.com
Tue Jul 30 13:39:15 PDT 2013


On Tue, Jul 30, 2013 at 1:32 PM, Matt Arsenault <arsenm2 at gmail.com> wrote:
> O n Jul 30, 2013, at 13:25 , Eli Friedman <eli.friedman at gmail.com> wrote:
>>
>> CastInst::getCastOpcode should just die.  We generally don't want the
>> full generality of getCastOpcode; LLVM IR isn't C.
>
> Sure, but the problem I'm trying to solve is dying in a case that is valid because there isn't enough information in the function. getCastOpcode doesn't know the pointer sizes, so it can only die if the address spaces don't match. It doesn't need to die if the sizes match, but it doesn't have a way of knowing that currently.

You could pass in a DataLayout pointer... but really, just kill it.
It'll be easier to reason about a method that isn't trying to compute
every possible cast.

-Eli




More information about the llvm-commits mailing list