dynamic Instruction Count

how to actually count the dynamic instructions in the code? I am trying to write a pass, i have built it successfully too but still getting the error when trying to run with a file.
bash: /home/haier/Documents/build/bin/opt: Permission denied

Did you ensure the file is executable (chmod +x bin/opt and ls -l bin/opt will probably give you that information).