[LLVMdev] isSafeToSpeculativelyExecute() for CallInst

Duncan Sands baldrick at free.fr
Sat Sep 8 22:39:28 PDT 2012


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.



More information about the llvm-dev mailing list