JIT: Remove some unnecessary instructions.

From: Xing Guo <higuoxing(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: JIT: Remove some unnecessary instructions.
Date: 2024-08-30 03:55:17
Message-ID: CACpMh+C=g13WdvzLRSponsVWGgxwDSMzQWM4Gz0heOyaA0-N6g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
0001-JIT-Remove-some-unnecessary-instructions.patch text/x-patch 2.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alexander Lakhin 2024-08-30 04:00:00 Re: configure failures on chipmunk
Previous Message Peter Smith 2024-08-30 02:43:10 Re: Introduce XID age and inactive timeout based replication slot invalidation