<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial"><br><div>Hi,</div><div>  Thanks for your answer.</div><div>  I am looking for a map, and the data structure of this map is</div><div>  map<const Instruction *, vector<MachineInstr*> ></div><div>In this map, its keyvalue is IR instruction pointer, and</div><div>its second value is a container which is composed of MachineInstr lowering by its keyvalue.</div><div><br></div><div>For example:</div><div>IR Instruction </div><div>%0 = load i32* getelementptr inbounds ([6 x i32]* @a, i32 0, i32 5), align 4, !tbaa !0</div><div>Two MachineInstrs lowed by this IR are shown following and used as This IR's second value in the map</div><div>%vreg0<def> = MOVi32 <ga:@a>; GPR:%vreg0</div><div>%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</div><div><br></div><div>  The reason I am looking for the above map is that I try to port Swing Modulo Scheduling</div><div>code updated by Tanya M.Latter in LLVM1.7 to LLVM3.3.</div><div>And this map was used in the original SMS code of LLVM1.7.</div><div>By the way, have you/someone considered coding/porting target-indenpent SMS in latest</div><div>version of LLVM? Or have any suggestion for porting these code?</div><div><br></div><div>Best Wishes</div><div>-Haishan</div><br><br><br><div></div><div id="divNeteaseMailCard"></div><br><pre><br>At 2013-12-13 01:35:01,"James Courtier-Dutton" <james.dutton@gmail.com> wrote:
>On 12 December 2013 13:58, Haishan <hndxvon@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.
</pre></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>