<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">+<br>+ virtual const char *getPassName() const { return "X86 Atom LEA Fixup";}<br>+ void seekLEAFixup(MachineOperand& p, MachineBasicBlock::iterator& I,<br>+ MachineFunction::iterator MFI);<br>+ void processInstruction(MachineBasicBlock::iterator& I,<br>+ MachineFunction::iterator MFI);<br>+ RegUsageState usesRegister(MachineOperand& p,<br>+ MachineBasicBlock::iterator I);<br>+ MachineBasicBlock::iterator searchBackwards(MachineOperand& p,<br>+ MachineBasicBlock::iterator& I,<br>+ MachineFunction::iterator MFI);<br>+ MachineInstr* postRAConvertToLEA(MachineFunction::iterator &MFI,<br>+ MachineBasicBlock::iterator &MBBI,<br>+ LiveVariables *LV) const;<br>+<br></div></blockquote><div><br></div><div>Can you please document the declarations of these functions ?</div><div>( see <a href="http://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments">http://llvm.org/docs/CodingStandards.html#doxygen-use-in-documentation-comments</a> )</div><div><br></div><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>+<br>+/// postRAConvertToLEA - if an instruction can be converted to an<span class="Apple-converted-space"> </span><br>+/// equivalent LEA, insert the new instruction into the basic block<br>+/// and return a pointer to it. Otherwise, return zero.<br>+MachineInstr *<br>+FixupLEAPass::postRAConvertToLEA(MachineFunction::iterator &MFI,<br>+ MachineBasicBlock::iterator &MBBI,<br>+ LiveVariables *LV) const {<br></div></blockquote><div><br></div><div><br></div><div>Preston, LiveVariables are not available in this phase and it is only confusing. Please remove them from the code. </div><div><br></div><div>+ LV = getAnalysisIfAvailable<LiveVariables>(); <----- this will always return 0. Did you ever get a LiveVariable instance ?<br></div><div><br></div><blockquote type="cite"><div style="letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">+ // Process all basic blocks.<br>+ for (MachineFunction::iterator I = Func.begin(), E = Func.end(); I != E; ++I)<br>+ processBasicBlock(Func, I);<br>+ DEBUG(dbgs() << "End X86FixupLEAs\n";);<br>+<br>+ return true;<br>+}<br></div></blockquote><div><br></div><div><br></div><div><div>This function always returns true. You probably only want to return true of the code changed. </div><div><br></div></div></div><div>Can you reduce the size of the test cases ? Ideally I would like to see a single-basic block function. You only need 5-instructions or so. Why did you include such long tests ?</div><div><br></div><div><br></div><div><br></div></body></html>