Thread

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

  1. JIT: Remove some unnecessary instructions.

    Xing Guo <higuoxing@gmail.com> — 2024-08-30T03:55:17Z

    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
    
  2. Re: JIT: Remove some unnecessary instructions.

    Andreas Karlsson <andreas@proxel.se> — 2024-08-30T12:50:51Z

    On 8/30/24 5:55 AM, Xing Guo wrote:
    > I find there are some unnecessary load/store instructions being
    > emitted by the JIT compiler.
    
    Well spotted! All of these are obvious dead instructions and while LLVM 
    might be able to optimize them away there is no reason to create extra 
    work for the optimizer.
    
    The patch looks good, applies and the tests passes.
    
    Andreas
    
    
    
    
  3. Re: JIT: Remove some unnecessary instructions.

    Xing Guo <higuoxing@gmail.com> — 2024-09-02T02:23:49Z

    On Fri, Aug 30, 2024 at 8:50 PM Andreas Karlsson <andreas@proxel.se> wrote:
    >
    > On 8/30/24 5:55 AM, Xing Guo wrote:
    > > I find there are some unnecessary load/store instructions being
    > > emitted by the JIT compiler.
    >
    > Well spotted! All of these are obvious dead instructions and while LLVM
    > might be able to optimize them away there is no reason to create extra
    > work for the optimizer.
    >
    > The patch looks good, applies and the tests passes.
    
    Thanks for testing it! I spotted another unnecessary store instruction
    and added it in my V2 patch.
    
    Best Regards,
    Xing
    
  4. Re: JIT: Remove some unnecessary instructions.

    Andreas Karlsson <andreas@proxel.se> — 2024-09-02T19:06:27Z

    On 9/2/24 4:23 AM, Xing Guo wrote:
    > Thanks for testing it! I spotted another unnecessary store instruction
    > and added it in my V2 patch.
    
    Another well-spotted unnecessary store. Nice!
    
    I think this patch is ready for committer. It is simple and pretty 
    obviously correct.
    
    Andreas
    
    
    
    
    
  5. Re: JIT: Remove some unnecessary instructions.

    Andreas Karlsson <andreas@proxel.se> — 2024-09-02T19:10:54Z

    On 9/2/24 9:06 PM, Andreas Karlsson wrote:
    > On 9/2/24 4:23 AM, Xing Guo wrote:
    >> Thanks for testing it! I spotted another unnecessary store instruction
    >> and added it in my V2 patch.
    > 
    > Another well-spotted unnecessary store. Nice!
    > 
    > I think this patch is ready for committer. It is simple and pretty 
    > obviously correct.
    
    Oh, and please add your patch to the commitfest app so it is not lost.
    
    https://commitfest.postgresql.org/50/
    
    Andreas
    
    
    
    
    
  6. Re: JIT: Remove some unnecessary instructions.

    Heikki Linnakangas <hlinnaka@iki.fi> — 2024-11-15T08:09:53Z

    On 02/09/2024 22:06, Andreas Karlsson wrote:
    > On 9/2/24 4:23 AM, Xing Guo wrote:
    >> Thanks for testing it! I spotted another unnecessary store instruction
    >> and added it in my V2 patch.
    > 
    > Another well-spotted unnecessary store. Nice!
    > 
    > I think this patch is ready for committer. It is simple and pretty 
    > obviously correct.
    
    Committed, thanks!
    
    -- 
    Heikki Linnakangas
    Neon (https://neon.tech)