JIT: Remove some unnecessary instructions.

Xing Guo <higuoxing@gmail.com>

From: Xing Guo <higuoxing@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2024-08-30T03:55:17Z
Lists: pgsql-hackers

Attachments

Hi hackers,

I find there are some unnecessary load/store instructions being
emitted by the JIT compiler.

E.g.,

```
v_boolnull = l_load(b, TypeStorageBool, v_resnullp, "");
v_boolvalue = l_load(b, TypeSizeT, v_resvaluep, "");

/* set resnull to boolnull */
LLVMBuildStore(b, v_boolnull, v_resnullp);
/* set revalue to boolvalue */
LLVMBuildStore(b, v_boolvalue, v_resvaluep);
```

v_boolnull is loaded from v_resnullp and stored to v_resnullp immediately.
v_boolvalue is loaded from v_resvaluep and stored to v_resvaluep immediately.

The attached patch is trying to fix them.

Best Regards,
Xing

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. jit: Stop emitting some unnecessary instructions