How to build a map between IR Instruction and MachineInstrs?

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

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 = MOVi32 ga:a; GPR:%vreg0
%vreg1 = 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

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