On Oct 20, 2010, at 12:52 AM, leledumbo wrote:>> >> No, you could throw it into a global if you know you're going to want to > use 5 at some point in the future randomly. > > OK, I guess that's the way I should treat it. Load from global to register, > do operations, store it back.I suppose, it'd be no different than doing this in a C file: static const int five = 5; and then using "five" all over the place instead of 5. Why not just use ConstantInt::get() when you want the number 5? -eric
> Why not just use ConstantInt::get() when you want the number 5?Because I'm not using LLVM libraries, I'm generating LLVM assembly myself. -- View this message in context: http://old.nabble.com/How-to-assign-a-constant-to-a-register--tp29987387p30008156.html Sent from the LLVM - Dev mailing list archive at Nabble.com.
On 20/10/10 11:37, leledumbo wrote:> >> Why not just use ConstantInt::get() when you want the number 5? > > Because I'm not using LLVM libraries, I'm generating LLVM assembly myself.In that case, why not output '5' when you want 5? Ciao, Duncan.
Maybe Matching Threads
- [LLVMdev] Re : How to assign a constant to a register?
- [LLVMdev] Re : How to assign a constant to a register?
- [LLVMdev] Re : How to assign a constant to a register?
- [LLVMdev] Re : How to assign a constant to a register?
- [LLVMdev] How to assign a constant to a register?