use matches!() macro in more places
Please read the rustc-dev-guide chapter on Backend Agnostic Codegen.