<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    <font size="+1">I have the following prototype for a function:<br>
      void bkp_memory(char *, int);<br>
      <br>
      Inside my LLVM IR, I have a callsite looks like the following:<br>
    </font>
    <pre wrap="">tail call void @bkp_memory(i8* bitcast (i32** @P to i8*), i32 4) nounwind


</pre>
    When I try to obtain its 1st argument and check whether it is a
    valid instruction, using:<br>
    Instruction *Inst = dyn_cast<Instruction
    *>(I->getOperand(0));<br>
    <br>
    it gives me a NULL Ptr, which is quite a surprise to me.<br>
    <br>
    Am I doing anything wrong here?<br>
    <br>
    <br>
    Note that in many other cases, the bkp_memory() callsite won't have
    the embedded form. They look like:<br>
    <pre wrap="">  store i32* %21, i32** @P, align 4
  %22 = bitcast i32* %21 to i8*
  tail call void @bkp_memory(i8* %22, i32 4) nounwind

And the dyn_cast<> conversion is fine in these cases.
</pre>
    Would that be the problem?<br>
    <br>
    <br>
    Thank you<br>
    <br>
    Chuck<br>
    <br>
  </body>
</html>