<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - `mayReadOrWriteMemory` method behaviour in `Instruction` class"
href="https://bugs.llvm.org/show_bug.cgi?id=37756">37756</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>`mayReadOrWriteMemory` method behaviour in `Instruction` class
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>osanwevpk@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Hello,
In the comment to `mayReadOrWriteMemory` method [1] said that it resurns "true
if this instruction may read or write memory".
Unfortunatelly, if we check both `mayWriteToMemory` and `mayReadFromMemory`
methods [2, 3], they do not check opcode Alloca.
But in language reference said that "the `alloca` instruction allocates
sizeof(<type>)*NumElements bytes of memory on the runtime stack" [4]. Thus, it
is possible to say in other words, that `alloca` instruction modifies memory,
as said in the comment to `mayWriteToMemory` method, and I think this should be
checked in that method.
Or do I understand incorrectly the logic behind `mayReadOrWriteMemory` method?
Thank you,
Petr.
[1]
<a href="https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/Instruction.h#L496L498">https://github.com/llvm-mirror/llvm/blob/master/include/llvm/IR/Instruction.h#L496L498</a>
[2]
<a href="https://github.com/llvm-mirror/llvm/blob/master/lib/IR/Instruction.cpp#L523L541">https://github.com/llvm-mirror/llvm/blob/master/lib/IR/Instruction.cpp#L523L541</a>
[3]
<a href="https://github.com/llvm-mirror/llvm/blob/master/lib/IR/Instruction.cpp#L503L521">https://github.com/llvm-mirror/llvm/blob/master/lib/IR/Instruction.cpp#L503L521</a>
[4] <a href="https://llvm.org/docs/LangRef.html#alloca-instruction">https://llvm.org/docs/LangRef.html#alloca-instruction</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>