nfp: bpf: remove the trivial JSET optimization
authorJakub Kicinski <jakub.kicinski@netronome.com>
Thu, 20 Dec 2018 06:13:07 +0000 (22:13 -0800)
committerDaniel Borkmann <daniel@iogearbox.net>
Thu, 20 Dec 2018 16:28:28 +0000 (17:28 +0100)
The verifier will now understand the JSET instruction, so don't
mark the dead branch in the JIT as noop.  We won't generate any
code, anyway.

Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
drivers/net/ethernet/netronome/nfp/bpf/jit.c

index 662cbc21d9093ae40e41ebe70b14fde8cefb8c7d..f765e76e4924ba31cec51d7caa8a0156e507a928 100644 (file)
@@ -3054,11 +3054,6 @@ static int jset_imm(struct nfp_prog *nfp_prog, struct nfp_insn_meta *meta)
        u64 imm = insn->imm; /* sign extend */
        swreg tmp_reg;
 
-       if (!imm) {
-               meta->skip = true;
-               return 0;
-       }
-
        if (imm & ~0U) {
                tmp_reg = ur_load_imm_any(nfp_prog, imm & ~0U, imm_b(nfp_prog));
                emit_alu(nfp_prog, reg_none(),