load instruction memory operands value null

Hi,

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.

For “load instruction”, Machine Instruction dumps as below:

vr12 = LD_Iri %vr2, 0; mem:LD4[]

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.

What can be probable reasons for this behavior? or is this behavior expected?

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.

Thanks & Regards,
Pankaj

I felt I missed some additional information.

In the application, concerned pointer,
UInt8 *ubNzCoeffChromaU;
is declared in .h and used/initialized in .c file.
In a function, this is used as:
for(j=0;j<2;j++)
{
if(j==0)
{
TmpNzCoeffChromaUV = ubNzCoeffChromaU;
TmpChromaMacroblockUV = ChromaMacroblockU;
}
else
{
TmpNzCoeffChromaUV = ubNzCoeffChromaV;
TmpChromaMacroblockUV = ChromaMacroblockV;
}
}

We are processing single file using llc for multiple sources of application.