<html><body><div style="color:#000; background-color:#fff; font-family:Courier New, courier, monaco, monospace, sans-serif;font-size:10pt"><div style="RIGHT: auto"><SPAN style="RIGHT: auto"><VAR id=yui-ie-cursor></VAR>I felt I missed some additional information.</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">In the application, concerned pointer, </SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">UInt8 *ubNzCoeffChromaU;</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">is declared in .h and used/initialized in .c file.</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"> In a function, this is used as:<BR> for(j=0;j<2;j++)<BR> {<BR>   if(j==0)<BR>   {<BR>     TmpNzCoeffChromaUV = ubNzCoeffChromaU;<BR>     TmpChromaMacroblockUV = ChromaMacroblockU;<BR>   }<BR>   else<BR>   {<BR>     TmpNzCoeffChromaUV = ubNzCoeffChromaV;<BR>     TmpChromaMacroblockUV = ChromaMacroblockV;<BR>   }</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"> }</SPAN></div><SPAN style="RIGHT: auto">
<div style="RIGHT: auto">We are processing single file using llc for multiple sources of application.</div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">================</div>
<div style="RIGHT: auto">>>> (gdb) print MachInst->getParent()->dump()<BR>BB#12: derived from LLVM BB %for.body40<BR>Live Ins: %vr1 %vr2 %vr3 %vr4 %vr5 %vr6 %vr7 %vr8 %vr9 %vr10 %vr11<BR>Predecessors according to CFG: BB#10 BB#11</div>
<div style="RIGHT: auto">DBG_VALUE %vr1, 0, !"CodedBlockPatternAll"; line no:1010</div>
<div style="RIGHT: auto">%vr12<def> = LD_Iri %vr2<kill>, 0; mem:LD4[<unknown>] dbg:workplace/src/SsvEntropy.c:1069:6<BR>%vr13<def> = MOVr %vr6; dbg:workplace/src/SsvLibH264BpEntropyDecMB.c:1069:6</div>
<div style="RIGHT: auto">BNErr %vr3, %vr11, <BB#14>; dbg:workplace/src/SsvEntropy.c:1069:6<BR>Successors according to CFG: BB#13 BB#14</div>
<div style="RIGHT: auto">$48 = void</div>
<div style="RIGHT: auto"><BR style="RIGHT: auto">>>> (gdb) print MachInst->getParent()->getPrev()->dump()<BR>BB#11: derived from LLVM BB %for.body40<BR>Live Ins: %vr1 %vr3 %vr4 %vr5 %vr6 %vr7 %vr8 %vr9 %vr10 %vr11<BR>Predecessors according to CFG: BB#10<BR>DBG_VALUE %vr1, 0, !"CodedBlockPatternAll"; line no:1010</div>
<div style="RIGHT: auto">%vr2<def> = MOVga <ga:@ubNzCoeffChromaU>; dbg:workplace/src/SsvEntropy.c:1071:7</div>
<div style="RIGHT: auto">Successors according to CFG: BB#12<BR>$49 = void</div>
<div style="RIGHT: auto">--------------------- Definition of MOVga is -------------</div>
<div style="RIGHT: auto">def MOVga : InstXXX<(outs IntRegs:$dst), (ins i32imm:$src),<BR>                      "mov_ga $dst, $src",<BR>                      [(set IntRegs:$dst, (XXXMov tglobaladdr:$src))], Arith>;</div>
<div style="RIGHT: auto"><BR style="RIGHT: auto">-----------------------------------<BR>the .ll referenced is:<BR>for.body40:                                       ; preds = %for.inc250, %if.then32<BR>  %j.023 = phi i32 [ %inc251, %for.inc250 ], [ 0, %if.then32 ]<BR> %12 = load i8** @ubNzCoeffChromaU, align 4, !dbg !1212<BR>  tail call void @llvm.dbg.value(metadata !{i8* %12}, i64 0, metadata !1214), !dbg !1212<BR>  tail call void @llvm.dbg.value(metadata !{i16* %add.ptr}, i64 0, metadata !1215), !dbg !1216<BR>  %13 = load i8** @ubNzCoeffChromaV, align 4, !dbg !1217<BR>  tail call void @llvm.dbg.value(metadata !{i8* %13}, i64 0, metadata !1214), !dbg !1217<BR>  tail call void @llvm.dbg.value(metadata !{i16* %add.ptr2}, i64 0,
 metadata !1215), !dbg !1219<BR>  %TmpNzCoeffChromaUV.0 = select i1 %cmp41, i8* %12, i8* %13, !dbg !1208<BR>  %TmpChromaMacroblockUV.0 = select i1 %cmp41, i16* %add.ptr, i16* %add.ptr2, !dbg !1208</div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">================<BR>While analyzing, I found,</div>
<div style="RIGHT: auto">In file "lib/Target/X86/X86ISelLowering.cpp"<BR>---------------------  MI creation --------------------<BR> MachineBasicBlock *MBB </div>
<div style="RIGHT: auto"> MachineFunction *F = MBB->getParent();</div>
<div style="RIGHT: auto"> int64_t RegSaveFrameIndex = MI->getOperand(1).getImm();<BR> int64_t VarArgsFPOffset = MI->getOperand(2).getImm();</div>
<div style="RIGHT: auto"><BR style="RIGHT: auto"> for (int i = 3, e = MI->getNumOperands(); i != e; ++i) {<BR>    int64_t Offset = (i - 3) * 16 + VarArgsFPOffset;<BR>   <BR>    MachineMemOperand *MMO =<BR>        F->getMachineMemOperand(<BR>                           MachinePointerInfo::getFixedStack(RegSaveFrameIndex, Offset),<BR>                           MachineMemOperand::MOStore,<BR>              /*Size=*/16, /*Align=*/16);</div>
<div style="RIGHT: auto">    BuildMI(XMMSaveMBB, DL, TII->get(MOVOpc))<BR>        .addFrameIndex(RegSaveFrameIndex)<BR>       .addImm(/*Scale=*/1)<BR>       .addReg(/*IndexReg=*/0)<BR>       .addImm(/*Disp=*/Offset)<BR>       .addReg(/*Segment=*/0)<BR>       .addReg(MI->getOperand(i).getReg())<BR>       .addMemOperand(MMO);</div>
<div style="RIGHT: auto">  }<BR>==============================</div>
<div style="RIGHT: auto">I dumped, MI->getOperand(1)<BR>(gdb) print MachInst-><U style="RIGHT: auto">getOperand(1)<BR></U>$50 = (const llvm::MachineOperand &) @0x93848fc: {OpKind = 0 '\000', SubReg = 0 '\000', TargetFlags = 0 '\000',<BR>  IsDef = false, IsImp = false, IsKill = true, IsDead = false, IsUndef = false, IsEarlyClobber = false, IsDebug = false,<BR>  SmallContents = {RegNo = 13, OffsetLo = 13}, ParentMI = 0x93e7868, Contents = {MBB = 0x93e63c0, CFP = 0x93e63c0,<BR>    CI = 0x93e63c0, <U>ImmVal</U> = <U>667464718549410752,</U> MD = 0x93e63c0, Sym = 0x93e63c0, Reg = {Prev = 0x93e63c0,<BR>      Next = 0x9434fa0}, OffsetedInfo = {Val = {Index = 155083712, SymbolName = 0x93e63c0 "\374H8\t", GV = 0x93e63c0,<BR>        BA = 0x93e63c0}, OffsetHi = 155406240}}}</div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">where I see some garbage immediate value.</div>
<div style="RIGHT: auto"> </div>
<div style="RIGHT: auto">And for MI-><U style="RIGHT: auto">getOperand(2)</U></div>
<div style="RIGHT: auto">(gdb) print MachInst-><U style="RIGHT: auto">getOperand(2)</U></div>
<div style="RIGHT: auto">$52 = (const llvm::MachineOperand &) @0x9384910: {OpKind = 1 '\001', SubReg = 83 'S', TargetFlags = 0 '\000', IsDef = false,<BR>  IsImp = false, IsKill = false, IsDead = true, IsUndef = false, IsEarlyClobber = false, IsDebug = false, SmallContents = {<BR>    RegNo = 154502568, OffsetLo = 154502568}, ParentMI = 0x93e7868, Contents = {MBB = 0x0, CFP = 0x0, CI = 0x0, ImmVal = 0,<BR>    MD = 0x0, Sym = 0x0, Reg = {Prev = 0x0, Next = 0x0}, OffsetedInfo = {Val = {Index = 0, SymbolName = 0x0, GV = 0x0,<BR>        BA = 0x0}, OffsetHi = 0}}}<BR></SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">What I am concerned with is, is there a problem with SDNode creation or during MachineInstruction creation??</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">Thanks & Regards,</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto">Pankaj</SPAN></div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><SPAN style="RIGHT: auto"></SPAN> </div>
<div style="RIGHT: auto"><BR style="RIGHT: auto"></div>
<DIV style="FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif; FONT-SIZE: 10pt">
<DIV style="FONT-FAMILY: times new roman, new york, times, serif; FONT-SIZE: 12pt">
<DIV dir=ltr><FONT size=2 face=Arial>
<DIV style="BORDER-BOTTOM: #ccc 1px solid; BORDER-LEFT: #ccc 1px solid; PADDING-BOTTOM: 0px; LINE-HEIGHT: 0; MARGIN: 5px 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; HEIGHT: 0px; FONT-SIZE: 0px; BORDER-TOP: #ccc 1px solid; BORDER-RIGHT: #ccc 1px solid; PADDING-TOP: 0px" class=hr contentEditable=false readonly="true"></DIV><B><SPAN style="FONT-WEIGHT: bold">From:</SPAN></B> Pankaj Gode <godepankaj@yahoo.com><BR><B><SPAN style="FONT-WEIGHT: bold">To:</SPAN></B> llvm Developers <llvmdev@cs.uiuc.edu> <BR><B><SPAN style="FONT-WEIGHT: bold">Sent:</SPAN></B> Friday, March 30, 2012 12:10 PM<BR><B><SPAN style="FONT-WEIGHT: bold">Subject:</SPAN></B> [LLVMdev] load instruction memory operands value null<BR></FONT></DIV><BR>
<DIV id=yiv181859182>
<DIV>
<DIV style="BACKGROUND-COLOR: #fff; FONT-FAMILY: Courier New, courier, monaco, monospace, sans-serif; COLOR: #000; FONT-SIZE: 10pt">
<DIV>Hi,</DIV>
<DIV> </DIV>
<DIV>For a custom target, there is a pass to perform memory dependence analysis, where, i need to get memory pointer for "load instruction". I want to check the pointer alias behavior. I am getting this by considering the memoperands for the load instruction. </DIV>
<DIV> </DIV>
<DIV>For "load instruction", Machine Instruction dumps as below:</DIV>
<DIV> </DIV>
<DIV>vr12<def> = LD_Iri %vr2<kill>, 0; mem:LD4[<unknown>]</DIV>
<DIV> </DIV>
<DIV>I checked for memoperands for this MachInst, which are not empty, as "has_empty()" returns false. When I check "Value *", pointed by memoperands_begin() and memoperands_end(), i get NULL value. Thus, I don't the the memory pointer.</DIV>
<DIV> </DIV>
<DIV>What can be probable reasons for this behavior? or is this behavior expected? </DIV>
<DIV> </DIV>
<DIV>I have also checked in the lib/CodeGen/SelectionDAG/InstrEmitter.cpp, where MachineInstruction node is created from SDNode, but couldn't get much clue on this.</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV>Thanks & <VAR id=yiv181859182yui-ie-cursor></VAR>Regards,</DIV>
<DIV>Pankaj</DIV>
<DIV> </DIV>
<DIV> </DIV>
<DIV> </DIV></DIV></DIV></DIV><BR>_______________________________________________<BR>LLVM Developers mailing list<BR><A href="mailto:LLVMdev@cs.uiuc.edu" ymailto="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</A>        <A href="http://llvm.cs.uiuc.edu/" target=_blank>http://llvm.cs.uiuc.edu</A><BR><A href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target=_blank>http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</A><BR><BR><BR></DIV></DIV></div></body></html>