Given alias knowledge, how to optimize?

hi,

i have following 3 simple lines of LLVM code:

store i32 100, i32* @XXX ; (1)
%2 = load i32* %1 ; (2)
store i32 %2, i32* @XXX ; (3)

my question: is there any trick to optimize away line (1), given that
i know (for sure) that @XXX does not alias to %1?

if this is possible, how can i tell the optimizer that @XXX does not
alias to %1?

thanks so much,
Jun

Hi Jun,

i have following 3 simple lines of LLVM code:

store i32 100, i32* @XXX ; (1)
%2 = load i32* %1 ; (2)
store i32 %2, i32* @XXX ; (3)

my question: is there any trick to optimize away line (1), given that
i know (for sure) that @XXX does not alias to %1?

how do you know this?

if this is possible, how can i tell the optimizer that @XXX does not
alias to %1?

The answer to this depends on the reason why %1 can't alias @XXX.

Ciao, Duncan.