search for: setreg

Displaying 20 results from an estimated 75 matches for "setreg".

Did you mean: getreg
2018 Apr 02
0
Mapping virtual registers to physical registers
...s. They do exactly what their names suggest and they are not required to be used (unless, of course, you want to generate a load/store). In the code snippet below you create a local copy of MachineOperand, and then modify it. I'm assuming it's a typo because the changed made by calling setReg will be discarded one you go out of scope. Having said that, setReg can be used to change the register in the given operand. Make sure to change the subregister to 0, since physical registers are not allowed to have explicit subregisters in machine operands. Calling setIsDef on an existing oper...
2018 Mar 29
4
Mapping virtual registers to physical registers
...entation work. Basically, the programmer will have to specify where load and store instructions should be inserted in the target function being compiled in order to get and store values in memory. To assign a physical register to a virtual register present in a given operand, use ``MachineOperand::setReg(p_reg)``. To insert a store instruction, use ``TargetInstrInfo::storeRegToStackSlot(...)``, and to insert a load instruction, use ``TargetInstrInfo::loadRegFromStackSlot``. ... I tried the direct mapping as following: MachineOperand destination = MI->getOperand(0); Mac...
2018 Apr 03
1
Mapping virtual registers to physical registers
...ores. They do exactly what their names suggest and they are not required to be used (unless, of course, you want to generate a load/store). In the code snippet below you create a local copy of MachineOperand, and then modify it. I'm assuming it's a typo because the changed made by calling setReg will be discarded one you go out of scope. Having said that, setReg can be used to change the register in the given operand. Make sure to change the subregister to 0, since physical registers are not allowed to have explicit subregisters in machine operands. Calling setIsDef on an existing operand...
2009 Jul 17
2
[LLVMdev] Bug in LiveIntervals? Please Examine
...>getRegClass(Reg); unsigned NewVReg = mri_->createVirtualRegister(RC); MachineInstrBuilder MIB = BuildMI(*RMBB, RMI, RMI->getDebugLoc(), tii_->get(TargetInstrInfo::IMPLICIT_DEF), NewVReg); (*MIB).getOperand(0).setIsUndef(); RMO.setReg(NewVReg); RMO.setIsUndef(); RMO.setIsKill(); } Souldn't there be a call to vrm.grow() after each call to mri->createVirtualRegister()? -Dave
2006 Jun 26
2
[LLVMdev] Mapping bytecode to X86
....size main, .-main The problem is that, after the TwoAddressInstructionPass is used, the code is no longer in SSA form, and my register allocator rely on some SSA properties. I am using the Spiller in VirtRegMap.* to generate the code, but the incorrect mapping still happens when I invoke the setReg() method directly on machine operands. Any of you guys has some hints to help me to produce correct mapping without using the Two address pass? Thanks a lot, Fernando
2009 Jul 17
0
[LLVMdev] Bug in LiveIntervals? Please Examine
...t; unsigned NewVReg = mri_->createVirtualRegister(RC); > MachineInstrBuilder MIB = > BuildMI(*RMBB, RMI, RMI->getDebugLoc(), > tii_->get(TargetInstrInfo::IMPLICIT_DEF), NewVReg); > (*MIB).getOperand(0).setIsUndef(); > RMO.setReg(NewVReg); > RMO.setIsUndef(); > RMO.setIsKill(); > } > > Souldn't there be a call to vrm.grow() after each call to > mri->createVirtualRegister()? No. This function is run during the analysis stage. vrm is actually owned by the register allocator which...
2018 Mar 30
0
Mapping virtual registers to physical registers
...entation work. Basically, the programmer will have to specify where load and store instructions should be inserted in the target function being compiled in order to get and store values in memory. To assign a physical register to a virtual register present in a given operand, use ``MachineOperand::setReg(p_reg)``. To insert a store instruction, use ``TargetInstrInfo::storeRegToStackSlot(...)``, and to insert a load instruction, use ``TargetInstrInfo::loadRegFromStackSlot``. ... I tried the direct mapping as following: MachineOperand destination = MI->getOperand(0); Mac...
2006 Jun 26
0
[LLVMdev] Mapping bytecode to X86
...> The problem is that, after the TwoAddressInstructionPass is used, the > code is no longer in SSA form, and my register allocator rely on > some SSA properties. I am using the Spiller in VirtRegMap.* to generate > the code, but the incorrect mapping still happens when I invoke the > setReg() method directly on machine operands. Any of you guys has some > hints to help me to produce correct mapping without using the Two > address pass? You're missing one critical piece. Currently, the register allocator is in charge of removing one of the operands of a two address instruc...
2010 Jul 20
0
[LLVMdev] Spilling multi-word virtual registers
...> LiveIntervals::tryFoldMemoryOperand() if it matters). Obviously I need > to make some changes. But what? This is quite simple to handle. A register MachineOperand has a subreg field for this purpose. It is used to pick out subregisters of a virtual register. For a physical register: MO.setReg(TRI.getSubReg(Reg, SubIdx)); For a virtual register: MO.setReg(Reg); MO.setSubReg(SubIdx); If you are using BuildMI, the subreg is passed as the third argument to addReg(). The register allocator (rewriter to be exact) will clear the subreg field when substituting the allocated physical reg...
2013 Mar 19
0
Windows batchfiles 0.7-1
...the Windows cmd line do this: R gui R.bat locates R, MiKTeX and Rtools using the registry or heuristics and then runs the subcommand indicated by the first argument. In addition to the gui subcommand, the following subcommands are available: cd, cmd, dir, gui, help, ls, path, R, script, show, SetReg, tools, touch. Some examples are: R -- run R.exe R gui -- run Rgui.exe R CMD build mypkg -- run Rcmd.exe build mypkg R script myScript.R -- run Rscript.exe myScript.R R dir -- list directories in R_ROOT, typically those in C:\Program Files\R R ls -- same R help -- help info R show -- show R_ var...
2013 Mar 19
0
Windows batchfiles 0.7-1
...the Windows cmd line do this: R gui R.bat locates R, MiKTeX and Rtools using the registry or heuristics and then runs the subcommand indicated by the first argument. In addition to the gui subcommand, the following subcommands are available: cd, cmd, dir, gui, help, ls, path, R, script, show, SetReg, tools, touch. Some examples are: R -- run R.exe R gui -- run Rgui.exe R CMD build mypkg -- run Rcmd.exe build mypkg R script myScript.R -- run Rscript.exe myScript.R R dir -- list directories in R_ROOT, typically those in C:\Program Files\R R ls -- same R help -- help info R show -- show R_ var...
2014 Sep 25
2
[LLVMdev] MachineRegisterInfo use_iterator/reg_iterator?
...as the machine > function? > > > Yes, the use_iterator list is not constructed in the same order as the > machine function. > > Maybe from the order that DAG is constructed? > > > No, this is not the case either. > The list is constructed via calls to MachineInstr::setReg (which calls > MachineRegisterInfo::addRegOperandToUseList if you are interested by the > details), which could basically occur anywhere in the backend. > That said, the main users of this interface is the VirtRegMap pass, which > walks through the function and set the register along th...
2010 Jul 20
2
[LLVMdev] Spilling multi-word virtual registers
Does anybody have any tips for generating spills/reloads for large non-vector registers? I'm working on a back end for a DSP architecture that has accumulator registers that are too large to be spilled or reloaded with a single instruction. All of their bits can be accessed in word-size chunks via three sub-registers (low, high, and ext). So loading or storing one requires three instructions:
2006 Aug 21
0
[LLVMdev] Recalculating live intervals
...t); for(unsigned t = 0; t < mi->getNumOperands(); t++) { MachineOperand & mo_aux = mi->getOperand(t); if(mo_aux.isRegister() && mo_aux.getReg() && mo_aux.isUse()) { if(mo_aux.getReg() == v_reg) { mo_aux.setReg(new_reg); this->reg_mapping->set_color_spilled_register (new_reg, p_reg); } } } last_seen = mi; } // this method will clean the machine register, e.g. p_reg, tha...
2014 Sep 25
2
[LLVMdev] MachineRegisterInfo use_iterator/reg_iterator?
Hi folks, I would like to find out the machine instructions that use some given registers in the reverse order, and I came across these iterators (use_iterator/reg_iterator). However, there are two things I noticed: 1) These iterators seem to traverse the machine function a bit differently from what I get from the machine function dump. In other words, the use_iterator list is not constructed in
2006 Jun 27
2
[LLVMdev] Mapping bytecode to X86
...that, after the TwoAddressInstructionPass is used, the > > code is no longer in SSA form, and my register allocator rely on > > some SSA properties. I am using the Spiller in VirtRegMap.* to generate > > the code, but the incorrect mapping still happens when I invoke the > > setReg() method directly on machine operands. Any of you guys has some > > hints to help me to produce correct mapping without using the Two > > address pass? > > You're missing one critical piece. Currently, the register allocator is > in charge of removing one of the operands o...
2006 Aug 21
2
[LLVMdev] Recalculating live intervals
So what addIntervalsToSpills returns are new intervals to allocate with infinite weights, right? And I need not to allocate the old interval. Should hasStackSlot return true on its register then? On 8/21/06, Fernando Magno Quintao Pereira <fernando at cs.ucla.edu> wrote: > > > Well, someone correct me if am wrong, but, you still have to allocate > physical registers to them,
2007 Apr 12
8
[LLVMdev] Regalloc Refactoring
...&mop = mii->getOperand(i); if (mop.isRegister() && mop.getReg() && MRegisterInfo::isVirtualRegister(mop.getReg())) { // replace register with representative register unsigned reg = rep(mop.getReg()); mii->getOperand(i).setReg(reg); Doesn't that last statement actually do the rewrite? And how does this interact with the spill cost computation? I'm thinking separating out the spill cost computation is going to be a bit more work because right now it does some of its calculations in concert with this rewriting....
2017 Jun 27
4
Ok with mismatch between dead-markings in BUNDLE and bundled instructions?
...NDLE is introduced by InlineSpiller::spillAroundUses which has determined that the register is live: // Rewrite instruction operands. bool hasLiveDef = false; for (const auto &OpPair : Ops) { MachineOperand &MO = OpPair.first->getOperand(OpPair.second); MO.setReg(NewVReg); if (MO.isUse()) { if (!OpPair.first->isRegTiedToDefOperand(OpPair.second)) MO.setIsKill(); } else { if (!MO.isDead()) hasLiveDef = true; } So I suppose we could either make LiveIntervals::computeDeadValues mark the individ...
2009 Oct 20
7
[LLVMdev] request for help writing a register allocator
...orking program. > > - How do I replace a virtual register with a physical one? > > - Do I need to generate spill code to handle virtual registers that > > cannot be replaced with physical ones, and if so, how? > You could re-write it in place (using MachineRegisterOperand::setReg(<reg>) if you want to manipulate the code yourself, or you can store the mapping in a VirtRegMap object and have the LLVM VirtRegRewriter apply the changes for you. The latter would have to be used in conjunction with the other LLVM regalloc components. You'd get liveness (LiveIntervals)...