]> The Tcpdump Group git mirrors - libpcap/commitdiff
optimizer: add a comment, move a statement.
authorGuy Harris <[email protected]>
Sun, 21 Jan 2024 23:37:16 +0000 (15:37 -0800)
committerGuy Harris <[email protected]>
Sun, 21 Jan 2024 23:37:16 +0000 (15:37 -0800)
Put the vstore() call that marks a no-longer-stored value as unknown
above the optimizer loop detection hack code, to keep the hack code more
clearly separated.

Add a comment indicating a reason for the vstore() call.

optimize.c

index 215f2c98e113985f6071d6458700e5f9fb5e21c7..6ef076182365bd7a703a4d1cc3f63f6d62edbccf 100644 (file)
@@ -1453,12 +1453,17 @@ opt_deadstores(opt_state_t *opt_state, register struct block *b)
        for (atom = 0; atom < N_ATOMS; ++atom)
                if (last[atom] && !ATOMELEM(b->out_use, atom)) {
                        last[atom]->code = NOP;
+                       /*
+                        * The store was removed as it's dead,
+                        * so the value stored into now has
+                        * an unknown value.
+                        */
+                       vstore(0, &b->val[atom], VAL_UNKNOWN, 0);
                        /*
                         * XXX - optimizer loop detection.
                         */
                        opt_state->non_branch_movement_performed = 1;
                        opt_state->done = 0;
-                       vstore(0, &b->val[atom], VAL_UNKNOWN, 0);
                }
 }