[LLVMdev] LICM for function calls

Philip Reames listmail at philipreames.com
Fri Jul 17 09:44:06 PDT 2015


On 07/16/2015 03:57 AM, Kuperstein, Michael M wrote:
> The common case is wanting LICM to hoist a loop-invariant function call into the pre-header of a loop where the trip count is unknown - and, in particular, not known to be > 0.
Just to clarify, I assume that you mean a read only idempotent function 
right?  (i.e. running it only once is not observable vs running it many 
times in the loop)  Or do you mean a read only side effect free function 
(i.e. running it once is indistinguishable from 0 or many runs)?  We 
could - and should - support both, but they're slightly different.

(I'm assuming no aliasing writes in both cases above.)
>
> -----Original Message-----
> From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Hal Finkel
> Sent: Thursday, July 16, 2015 08:38
> To: Raoux, Thomas F
> Cc: llvmdev at cs.uiuc.edu
> Subject: Re: [LLVMdev] LICM for function calls
>
> I think we'd need some kind of 'safe_to_speculate' attribute on the function. Regarding the optimization, under what circumstances would you want to speculate a function? I can imagine doing this only if I knew the function would be lowered in the backend to some simple set of instructions.
>
>   -Hal
> ---------------------------------------------------------------------
> Intel Israel (74) Limited
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
>
> _______________________________________________
> 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