[LLVMdev] isSafeToSpeculativelyExecute() for CallInst

Nadav Rotem nrotem at apple.com
Sun Sep 9 00:37:22 PDT 2012


So we have a bug in canSinkOrHoistInst  because it only checks for memory deps.


On Sep 9, 2012, at 8:39 AM, Duncan Sands <baldrick at free.fr> wrote:

> Hi Nadav,
> 
> On 08/09/12 22:51, Nadav Rotem wrote:
>> 
>> On Aug 19, 2012, at 2:55 PM, "Kuperstein, Michael M"
>> <michael.m.kuperstein at intel.com <mailto:michael.m.kuperstein at intel.com>> wrote:
>> 
>>> Hello,
>>> Currently, llvm::isSafeToSpeculativelyExecute() always returns false for Call
>>> instructions.
>>> This has actual performance implications, because loop-invariant code motion
>>> makes this check, and will never hoist instructions that are not safe to
>>> speculatively execute.
>> 
>> LICM::canSinkOrHoistInst has special handling for hoisting Call Instructiobns.
>>  It looks like readonly functions should be hoisted. Do you have test cases
>> which fail ?
> 
> a readonly/readnone function may contain divide by zero.
> 
> Ciao, Duncan.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120909/2c2b5a14/attachment.html>


More information about the llvm-dev mailing list