[llvm-commits] [llvm] r128140 - in /llvm/trunk: lib/Analysis/BasicAliasAnalysis.cpp test/Analysis/BasicAA/non-escaping-local-object.ll
Duncan Sands
baldrick at free.fr
Wed Mar 23 02:38:49 PDT 2011
Hi Anders,
> A global variable with internal linkage where all uses are in one function and whose address is never taken is a non-escaping local object and can't alias anything else.
what about recursive functions?
> +define void @g(i32* nocapture %p) {
> + store i32 0, i32* @global
> +
> + ; @global is internal, is only used in this function, and never has its
> + ; address taken so it can't alias p.
> + ; CHECK: NoAlias: i32* %p, i32* @global
> + store i32 1, i32* %p
> + %1 = load i32* @global
> + ret void
> +}
For example, suppose @g called itself, passing @global for %p. Would the
"does not escape" check catch this?
Ciao, Duncan.
More information about the llvm-commits
mailing list