title: How to identify any type of instruction in LLVM/C++?
body: <p>I've been asked to do a LLVM function that allows me to find: jump/branch, load/store, call, 'arithmetic and other type of instruction'.</p>
  
  <p>As far as I managed to do, I've been able to find the CallInst, LoadInst, StoreInst and BranchInst doing the following code with dyn_cast:</p>
  
  <pre><code>for (const Function &amp;F : *M) 
      for (const BasicBlock &amp;BB : F) 
          for (const Instruction &amp;I : BB) 
              if (const StoreInst *SI = dyn_cast&lt;StoreInst&gt;(&amp;I)) 
                   count++;;
  </code></pre>
  
  <p>I'm struggling to find a way of extracting all the arithmetic and 'other type' instructions. </p>
  
  <p>Thanks for your time.</p>