[LLVMdev] Memset/memcpy: user control of loop-idiom recognizer

Robert Lougher rob.lougher at gmail.com
Wed Dec 3 15:36:50 PST 2014


On 2 December 2014 at 22:18, Alex Rosenberg <alexr at leftfield.org> wrote:
>
> Our C library amplifies this problem by being in a dynamic library, so the
> call has additional overhead, which for small trip counts swamps the
> copy/set.
>

I can't imagine we're the only platform (now or in the future) that
has comparatively slow library calls.  We had discussed some sort of
platform flag (has slow library calls) but this would be too late to
affect the loop-idiom.  However, it could affect lowering.  Following
on from Reid's earlier idea to lower short memcpys to an inlined,
slightly widened loop, we could expand into a guarded loop for small
values and a call?

> Game developers expect precise control and are surprised by this
> canonicalization. They also don't have the compiler's frame of reference as
> a basis for understanding issues like this.
>

Unfortunately this issue has now been noticed.  Whether or not we can
"get away" with fixing the performance issue without giving them the
control remains to be seen...

Rob.

> Alex
>
> -eric
>
>>
>> Rob.
>>
>> > _______________________________________________
>> > LLVM Developers mailing list
>> > LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>> _______________________________________________
>> LLVM Developers mailing list
>> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



More information about the llvm-dev mailing list