[LLVMdev] Optimization hints for "constant" loads

Sanjoy Das sanjoy at playingwithpointers.com
Tue Oct 21 11:46:22 PDT 2014

Thank you for the explanation, I think I misunderstood your solution
initially.  Is it accurate to say: by making the definition of the
source pointer of an !invariant load control (or data) dependent on
some initialization event, you can effectively separate the
initialization event (where the location is not invariant) and the
rest of the execution (where the location is invariant).

This approach looks similar to Ruby's "freeze" method:

What is the aliasing relationship between a non-invariant load from
the result of a safe_cast and a load from (or store to) the argument
we pass to it?  Is it sensible to make them MustAlias?  I'm trying to
think if a frontend needs to be careful about using the return value
of check_cast only for !invariant loads (or some other restriction),
or is it legal (or desirable) to mix and match both kinds of loads
from both kinds of pointers.

-- Sanjoy

More information about the llvm-dev mailing list