<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/57699>57699</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            General question about variable type of operand in add operation
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          Y-chav
      </td>
    </tr>
</table>

<pre>
    Hi,

I want to ask a general question about **add** operation in executable code. We know that type info is lost in executable code, but is there any any assumptions that pointer variable only can be placed at the left-hand side of an **add** instruction in executable code? 

<img width="202" alt="image" src="https://user-images.githubusercontent.com/44321769/189696261-60559d0e-a0a8-440d-ac57-ef163ce14c54.png">

For example, the above instruction contains an add operation **[rax+rcx]**, and at here the left-hand side rax register is a pointer and right-hand side rcx register is a scalar. Does this assumption always hold for all the architecture? Or is it possible that some optimization will break this assumption?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJx1U0tznDAM_jVw8cCAgV184JBkm7anHjs9CluAG4OpbXaz_fUVkKRJms7wMLIs6XvQWnVtvuiI30XZKcpu9udXdoEpsGAZ-AcGrMcJHRj2a0EftJ0YtHYJLOI3dIFS-4LZmbK2fT0xfES5BGgNMmkVpuw7sofJXlgYgEpfZ6SszjLtmbE-fHCEhmIttaGMMKBDBtN1v71fxnlt5Pdqs9VTQMfO4PR23E7myiRMrEU2G5Co2Np0QGawC8kAk2JeK0rsqOI_QPTkg1vkf6BExT17zVZU3OmxZxetwhAVp4hznnF6MjBh_9Yj9LhGvJN7ZAhh9lFB3e7pWjy6ZEvyaa_DsLRrRFoCNYVU2pFyyrLg-fEgaJnX4iAO_JAnh6yqhMowgQzqpCwzlYCsjgl2-aGQmJeyKtN56qljVHx6PfS9dYQLxtlsPK_UkKhnfIN9nQAosHJE7LwSeCcqqm4dPEb81snHqDo9Bancyi8Rvqn2Aet0iDnstV9FI3nhRcE1xel-eJMt32d7CQZcyk4WVwessRdLEOsXuHo2WKNYRyjBmB2ek4MOKMPiNgm_bcX06h7v9Sru5iVvR7IFlRr17x3rRVOF1iE8vO9FZWJs8sOBC3EsiipWTaFEISAOOhhsPn_837zYdPsLyIIbrwRXv6M5Xpxp3lplt8eTJ4w5P7-S2dmfBI4-Nc2HnhYV2UXEQ5N1vBPyWBeFamt15HVWC5lJntW5kKIUsYEWjW9ITlIx1g35l2ci53lV0p0WMuvyY513rVBQc4zKDEfQJl0bp9b1sWu2Gdql97RpSCr_d5P40v2E-FwfljBY1_xI5ADneJu22Ub9A2DdgMo">