search for: replacewithinstr

Displaying 3 results from an estimated 3 matches for "replacewithinstr".

2008 Jun 17
4
[LLVMdev] Transforming ConstantExprs to Instructions
...#39;m working on a pass that transforms global variables to local variables, and in particular the GetElementPtrConstantExpr is a bit troublesome. For my transformation to properly work, a global value should only be used by Instructions, not by ConstantExprs. I was thinking to add a ConstantExpr::replaceWithInstr() virtual method, which translates all of the uses of a constantexpr with their Instruction equivalents, whenever possible. Each of the subclasses of ConstantExpr can implement this as appropriate. Or, thinking of it, it's probably better to have a protected and virtual replaceUseWithInstr meth...
2008 Jun 17
0
[LLVMdev] Transforming ConstantExprs to Instructions
...bit troublesome. For my transformation to > properly work, a global value should only be used by Instructions, not by > ConstantExprs. Ok, this is not possible in general though, global variable initializers have to be constants, not instructions. > I was thinking to add a ConstantExpr::replaceWithInstr() virtual method, which > translates all of the uses of a constantexpr with their Instruction > equivalents, whenever possible. Each of the subclasses of ConstantExpr can > implement this as appropriate. Or, thinking of it, it's probably better to > have a protected and virtual repl...
2008 Jun 17
0
[LLVMdev] Transforming ConstantExprs to Instructions
...'t escape, the value from the previous call to a function isn't used (by either ensuring the value is set before used, or ensuring that the value is set to a known constant when the function returns), and that there isn't any unsafe recursion. > I was thinking to add a ConstantExpr::replaceWithInstr() virtual method, which > translates all of the uses of a constantexpr with their Instruction > equivalents, whenever possible. Each of the subclasses of ConstantExpr can > implement this as appropriate. Or, thinking of it, it's probably better to > have a protected and virtual repl...