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

    <tr>
        <th>Summary</th>
        <td>
            the Opcode of different instructions is misaligned in clang15
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          my-code-cloud
      </td>
    </tr>
</table>

<pre>
    I may have found a bug with the clang-15 implementation.

my clang version is:
> Ubuntu clang version 15.0.0-++20220912113118+92e7ef99303f-1~exp1~20220912113220.52
> Target: x86_64-pc-linux-gnu

**Abstract: the execution results of **getOpcode()** were shifted forward by 3 from the opcode shown in the source code**

when I was writing a pass on my IR file and wanted to identify all *GetElementPtr* instruction via **getOpcode()**, what i wrote was `I.getOpcode() == Instruction :: GetElementPtr` but what I got was *Alloca* instructions. 
My compiler indicates that the opcode of GetElementPtr is 34, however the [source code](https://github.com/llvm/llvm-project/blob/cbde0d9c7be1991751dc3eb5928294d2e00ef26a/llvm/include/llvm/IR/Instruction.def) shows the opcode of GetElementPtr is 33. I further found that the execution results of **getOpcode()** were shifted forward by 3 from the opcode shown in the source code, i.e., I can only get  *GetElementPtr* instruction via `if (I.getOpcode() == Instruction :: AtomicRMW)`.

According to the source code:
`HANDLE_BINARY_INST(27, And  , BinaryOperator)`
`HANDLE_MEMORY_INST(30, Alloca, AllocaInst)`
`HANDLE_MEMORY_INST(33, GetElementPtr, GetElementPtrInst)`
`HANDLE_MEMORY_INST(36, AtomicRMW , AtomicRMWInst )`

I would be very grateful if the developers could help me to confirm if there is such an issue. I will provide more specific code and runtime environment information if needed.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzEVcFu4zYQ_Rr6MrBAUZZsHXywN0kroNkU6RZFTwuKHEosKFIgKSu-7LcXlJNN4gJt9lTAkGx6-Oa9x-EMD0F3FnFPyiMpb1Z8ir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