[LLVMdev] A question about LICM (Loop Invariant Code Motion)

Duncan Sands baldrick at free.fr
Tue Feb 8 01:55:44 PST 2011


Hi Yuelu,

> After tracking the LICM pass, I find that both loads are loop
> invariant, and canSinkOrHoist() also returns true; however the
> difference is at Instruction::isSafeToSpeculativelyExecute(),
> for load from function parameter pointer, it return false; with load
> from a global var pointer, it returns true. As a result no hoist
> happens for a load *fp:

the function parameter pointer might be null.

Ciao, Duncan.



More information about the llvm-dev mailing list