belive: Avoid duplicate map lookups when calculating the liveness of a node in a...
[libfirm] / ir / be / bearch.c
index 17b5296..5cd7cba 100644 (file)
@@ -48,13 +48,6 @@ arch_register_req_t const arch_no_requirement = {
        0
 };
 
-/* Initialize the architecture environment struct. */
-arch_env_t *arch_env_begin_codegeneration(const arch_isa_if_t *isa_if)
-{
-       arch_env_t *arch_env = isa_if->begin_codegeneration();
-       return arch_env;
-}
-
 /**
  * Get the isa responsible for a node.
  * @param irn The node to get the responsible isa for.
@@ -257,14 +250,14 @@ static void arch_dump_register_req(FILE *F, const arch_register_req_t *req,
 
 void arch_dump_reqs_and_registers(FILE *F, const ir_node *node)
 {
-       backend_info_t *info = be_get_info(node);
+       backend_info_t *const info  = be_get_info(node);
+       int             const n_ins = get_irn_arity(node);
        /* don't fail on invalid graphs */
-       if (info == NULL || info->in_reqs == NULL || info->out_infos == NULL) {
+       if (!info || (!info->in_reqs && n_ins != 0) || !info->out_infos) {
                fprintf(F, "invalid register requirements!!!\n");
                return;
        }
 
-       int n_ins  = get_irn_arity(node);
        for (int i = 0; i < n_ins; ++i) {
                const arch_register_req_t *req = arch_get_irn_register_req_in(node, i);
                fprintf(F, "inreq #%d = ", i);