In the 2.3 release, we included a list of the major LLVM API changes. If you are working on upgrading your code from 2.3 to 2.4, I'd appreciate it if you could compile a list of the major stumbling blocks you have, so that others can benefit from your experience. Please send any info to the list, thanks! -Chris
Hi, Chris Lattner wrote:> In the 2.3 release, we included a list of the major LLVM API changes. If you > are working on upgrading your code from 2.3 to 2.4, I'd appreciate it if you > could compile a list of the major stumbling blocks you have, so that others > can benefit from your experience. Please send any info to the list, thanks!No major stumbling blocks during our backend porting, just minor changes. I'll list them anyways: 1) Some method names in MachineOperand were renamed to abbreviated names like isFrameIndex() -> isFI(). 2) const class llvm::MachineInstr has no member named clone() The call to could be replaced with MachineFunction::CloneMachineInstr(); 3) llvm::TargetInstrInfo::copyRegToReg() now returns 'bool' This used to be a void function. Easy to fix by just returning a boolean. However, the comment in TargetInstrInfo.h does not state what the return value means, so one has to dig into the source code of the other backends. Looking at the ARM backend, the return value seems to just denote success, in case trying to copy between end points that are not supported by the instruction set (?). 4) SDOperand replaced with SDValue A simple text search-replace in the backend's TargetLowering implementation seemed to fix this. 5) ‘struct llvm::MVT::ValueType’ has not been declared typedef uint32_t ValueType is replaced with struct llvm::MVT. A text replace cured this. 6) error: ‘LABEL’ is not a member of ‘llvm::ISD’ Split to DBG_LABEL and EH_LABEL. In our case we needed only DBG_LABEL. 7) ‘LOCATION’ is not a member of ‘llvm::ISD’ Renamed to DBG_STOPPOINT. 8) error: ‘class llvm::SDValue’ has no member named ‘Val’ SDOperand had 'Val' which can be replaced by getNode(). 9) switch(op.getOperand(1).getValueType()) does not work In our case I could replace it with switch(op.getOperand(1).getValueType().getSimpleVT()) 10) SelectionDAGIsel::InstructionSelectBasicBlock removed Replaced with InstructionSelect() 11) no matching function for call to llvm::AsmPrinter::AsmPrinter(std::basic_ostream<char, std::char_traits<char>... The stream argument has been changed to llvm::raw_ostream Also had to change std::endls to '\n' in the AssemblyPrinter. 12) getSectionForFunction(*f) to f->getSection() 13) TargetLowering::LowerArguments() fingerprint changed It now takes the SmallVectorImpl<SDValue>& argValues as an output reference parameter and is a void function. 14) TargetLowering::LowerCallTo() has an additional bool argument isInreg BR, -- --Pekka, visit0r @ IRC
On Oct 13, 2008, at 9:00 AM, Pekka Jääskeläinen wrote:> > > 3) llvm::TargetInstrInfo::copyRegToReg() now returns 'bool' > > This used to be a void function. Easy to fix by just returning a > boolean. > > However, the comment in TargetInstrInfo.h does not state what the > return value means, so one has to dig into the source code of the > other backends. Looking at the ARM backend, the return value seems > to just denote success, in case trying to copy between end points > that are not supported by the instruction set (?).I have added comment. Thanks for reporting this. Evan> > > 4) SDOperand replaced with SDValue > > A simple text search-replace in the backend's TargetLowering > implementation seemed to fix this. > > 5) ‘struct llvm::MVT::ValueType’ has not been declared > > typedef uint32_t ValueType is replaced with struct llvm::MVT. > A text replace cured this. > > 6) error: ‘LABEL’ is not a member of ‘llvm::ISD’ > > Split to DBG_LABEL and EH_LABEL. In our case we needed > only DBG_LABEL. > > 7) ‘LOCATION’ is not a member of ‘llvm::ISD’ > > Renamed to DBG_STOPPOINT. > > 8) error: ‘class llvm::SDValue’ has no member named ‘Val’ > > SDOperand had 'Val' which can be replaced by getNode(). > > 9) switch(op.getOperand(1).getValueType()) does not work > > In our case I could replace it with > > switch(op.getOperand(1).getValueType().getSimpleVT()) > > 10) SelectionDAGIsel::InstructionSelectBasicBlock removed > > Replaced with InstructionSelect() > > 11) no matching function for call to > llvm::AsmPrinter::AsmPrinter(std::basic_ostream<char, > std::char_traits<char>... > > The stream argument has been changed to llvm::raw_ostream > > Also had to change std::endls to '\n' in the AssemblyPrinter. > > 12) getSectionForFunction(*f) to f->getSection() > > 13) TargetLowering::LowerArguments() fingerprint changed > > It now takes the SmallVectorImpl<SDValue>& argValues as an > output reference parameter and is a void function. > > 14) TargetLowering::LowerCallTo() has an additional > bool argument isInreg > > BR, > -- > --Pekka, visit0r @ IRC > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev