<!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">
LLVMers,<br>
<br>
I need to intercept all LLVM IR instructions that will write into
memory and start to do analysis on these instructions.<br>
<br>
In addition to StoreInst, what are all other IRs that will write
into memory?<br>
<br>
E.g.<br>
char * ptr = malloc(...);<br>
///...<br>
//with use(s) of ptr later<br>
<br>
The LLVM IR for the above code would be:<br>
<pre wrap=""> %0 = tail call noalias i8* @malloc(i32 137) nounwind
</pre>
///...<br>
// use(s) of %0<br>
<br>
LLVM's Language Reference has the instruction format for CallInst:<br>
<br>
<span class="Apple-style-span" style="border-collapse: separate;
color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-style:
normal; font-variant: normal; font-weight: normal; letter-spacing:
normal; line-height: normal; orphans: 2; text-indent: 0px;
text-transform: none; white-space: normal; widows: 2;
word-spacing: 0px; font-size: medium;"><span
class="Apple-style-span" style="text-align: left;">
<pre> <result> = [tail] call [<a href="http://llvm.org/docs/LangRef.html#callingconv">cconv</a>] [<a href="http://llvm.org/docs/LangRef.html#paramattrs">ret attrs</a>] <ty> [<fnty>*] <fnptrval>(<function args>) [<a href="http://llvm.org/docs/LangRef.html#fnattrs">fn attrs</a>]
</pre>
<br>
Does that mean any LLVM IR that has a valid result field will be
able to store the result into memory?<br>
<br>
How about those temps allocated into registers via register
allocation?<br>
Is there a way to tell such temps at compile time before RA?<br>
<br>
<br>
Thank you very much<br>
<br>
Chuck<br>
<br>
<br>
</span></span><br>
</body>
</html>