<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 - inaccessiblememonly and inaccessiblemem_or_argmemonly overwrite does not work on call with operand bundle"
   href="https://bugs.llvm.org/show_bug.cgi?id=35128">35128</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>inaccessiblememonly and inaccessiblemem_or_argmemonly overwrite does not work on call with operand bundle
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libraries
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>5.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </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>Scalar Optimizations
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>yyc1992@gmail.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>According to LangRef,

<span class="quote">> Calls and invokes with operand bundles have unknown read / write effect on the heap on entry and exit (even if the call target is readnone or readonly), unless they’re overridden with callsite specific attributes.</span >

However, the callsite specific override seems to only work for `readonly`,
`readnone`, `argmemonly` but not for `inaccessiblememonly` and
`inaccessiblemem_or_argmemonly` as shown by the test case below,

```
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%jl_value_t = type opaque

define i64 @f(i64* %p, i64 %v) {
  store i64 %v, i64* %p
  call void @g() #0 [ "unknown"(i64* %p) ]
  %v2 = load i64, i64* %p
  ret i64 %v2
}

declare void @g() #0

; attributes #0 = { inaccessiblememonly }
attributes #0 = { inaccessiblemem_or_argmemonly }
```

`opt -O3` does not remove the load instruction with either attributes but any
of the following does,

* Change the attribute to any one of `readonly`, `readnone`, `argmemonly`
* Remove the operand bundle.</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>