Haishan
2013-Dec-14 10:44 UTC
[LLVMdev] How to build a map between IR Instruction and MachineInstrs?
Hi, Thanks for your answer. I am looking for a map, and the data structure of this map is map<const Instruction *, vector<MachineInstr*> > In this map, its keyvalue is IR instruction pointer, and its second value is a container which is composed of MachineInstr lowering by its keyvalue. For example: IR Instruction %0 = load i32* getelementptr inbounds ([6 x i32]* @a, i32 0, i32 5), align 4, !tbaa !0 Two MachineInstrs lowed by this IR are shown following and used as This IR's second value in the map %vreg0<def> = MOVi32 <ga:@a>; GPR:%vreg0 %vreg1<def> = LOADi32 %vreg0, 20, pred:14, preg:%noreg; mem:LD4[getelementptr inbounds ([6 x i32]* @a, i32 0, i32 5)] (tbaa !="int") GPR:%vreg1,%vreg0 The reason I am looking for the above map is that I try to port Swing Modulo Scheduling code updated by Tanya M.Latter in LLVM1.7 to LLVM3.3. And this map was used in the original SMS code of LLVM1.7. By the way, have you/someone considered coding/porting target-indenpent SMS in latest version of LLVM? Or have any suggestion for porting these code? Best Wishes -Haishan At 2013-12-13 01:35:01,"James Courtier-Dutton" <james.dutton at gmail.com> wrote:>On 12 December 2013 13:58, Haishan <hndxvon at 163.com> wrote: >> Hi, >> I try to add a backend (machine function) pass in LLVM 3.3 source code. >> In order to analyse precise information of machine instructions, I need some >> information of >> IR instruction which corresponds to MachineInstrs. If so, it's much easier >> to analyse IR Instructions instead of MachineInstrs. >> However, in the frame of LLVM 3.3, I can't find the corresponding(connected) >> information >> from Instruction to MachineInstrs in the CodeGenAndEmitDAG function. >> PS: I once used IROrder which is a member of class SDNode as unchangeable >> information, but it's roughly corresponding information, so the map >> <Instruction*, vector<MachineInstr*> > often overlaps. >> Could someone help me with that? >> Thank you very much in advance. >> -Haishan >> > >What sort of map are you looking for? >IR is very different from MachineInstrs. >There is no one-to-one mapping. >Information is lost during the IR to MachineInstrs lowering steps and >due to optimizations done at the MachineInstrs level.-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131214/95f9340d/attachment.html>
fatum
2014-Apr-10 14:25 UTC
[LLVMdev] How to build a map between IR Instruction and MachineInstrs?
Haishan wrote> The reason I am looking for the above map is that I try to port Swing > Modulo Scheduling > code updated by Tanya M.Latter in LLVM1.7 to LLVM3.3. > And this map was used in the original SMS code of LLVM1.7. > By the way, have you/someone considered coding/porting target-indenpent > SMS in latest > version of LLVM? Or have any suggestion for porting these code?Hello, have you been successful in porting this? I would greatly appreciate even the working implementation as I'm working on the same thing. Is it available anywhere? - Fatum -- View this message in context: http://llvm.1065342.n5.nabble.com/How-to-build-a-map-between-IR-Instruction-and-MachineInstrs-tp64336p67661.html Sent from the LLVM - Dev mailing list archive at Nabble.com.