[llvm-commits] Patch for pr11798: Emit _fltused during FastISel

Michael Spencer bigcheesegs at gmail.com
Tue Feb 21 15:38:03 PST 2012


On Tue, Feb 21, 2012 at 12:02 PM, Joe Groff <arcata at gmail.com> wrote:
> On Tue, Feb 21, 2012 at 5:10 AM, Anton Korobeynikov
> <anton at korobeynikov.info> wrote:
>> Well... Do you have vcpp in hand? You can check in which conditions
>> call to fltused is emitted.
>> Typical cases:
>>  1. Ordinary floating point operand
>>  2. float*
>>  3. struct { float }
>>  4. struct { float } *
>
> It appears that VC generates a _fltused reference if a float type is
> referenced in any context, even if the type isn't ever used as an
> argument. Perhaps LLVM should be changed so that the "reference
> _fltused" flag is enabled when a FloatType is instantiated, rather
> than by checking CallInsts during instruction lowering. Is that a
> sensible change?
>
> -Joe

VC emits __fltused if you use the keyword float or double anywhere in
your program. I wrote the original code to emit __fltused, and decided
to restrict it to the places that the MSVCRT actually needs it, which
is specifically format string functions.

The reason it adds it for any vararg call passing a float is because
of vararg forwarding functions which may eventually call a format
string function.

I would prefer we emit it in as few cases as possible.

- Michael Spencer




More information about the llvm-commits mailing list