How to create new local variable

Hi,
     I want to implement a simple common sub expression pass in
llvm2.8 which demands replacing the uses of the redundant expressions
with a temporary variable. So, to introduce new temporary variable I
have inserted an AllocaInst (...) providing the name of the temporary
and desired type. But whenever I am going to insert a LoadInst for
that variable I am getting segmentation fault. It is telling that
llvm::Value::setName(...) fails and that has something to do with
llvm::ValueSymbolTable::createValueName(...) method. What should I do
to insert the local variable?

Thanks and regards,

Abhirup Ghosh
M. Tech
Department of Computer Science & Engg.
IIT, Bombay
email - abhirupju@gmail.com , abhirup@cse.iitb.ac.in

Hi Abhirup,

      I want to implement a simple common sub expression pass in
llvm2.8

the development version of LLVM gained exactly such a CSE pass, called
EarlyCSE.

  which demands replacing the uses of the redundant expressions

with a temporary variable. So, to introduce new temporary variable I
have inserted an AllocaInst (...) providing the name of the temporary
and desired type. But whenever I am going to insert a LoadInst for
that variable I am getting segmentation fault. It is telling that
llvm::Value::setName(...) fails and that has something to do with
llvm::ValueSymbolTable::createValueName(...) method. What should I do
to insert the local variable?

I suggest you post the code you are using to do this.

Ciao, Duncan.