https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119533

--- Comment #13 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Vineet Gupta <vine...@gcc.gnu.org>:

https://gcc.gnu.org/g:edb4867412895100b3addc525bc0dba0ea90c7f9

commit r15-9492-gedb4867412895100b3addc525bc0dba0ea90c7f9
Author: Vineet Gupta <vine...@rivosinc.com>
Date:   Tue Apr 15 09:29:08 2025 -0700

    RISC-V: vsetvl: elide abnormal edges from LCM computations [PR119533]

    vsetvl phase4 uses LCM guided info to insert VSETVL insns, including a
    straggler loop for "mising vsetvls" on certain edges. Currently it
    asserts on encountering EDGE_ABNORMAL.

    When enabling go frontend with V enabled, libgo build hits the assert.

    The solution is to prevent abnormal edges from getting into LCM at all
    (my prior attempt at this just ignored them after LCM which is not
    right). Existing invalid_opt_bb_p () current does this for BB predecessors
    but not for successors which is what the patch adds.

    Crucially, the ICE/fix also depends on avoiding vsetvl hoisting past
    non-transparent blocks: That is taken care of by Robin's patch
    "RISC-V: Do not lift up vsetvl into non-transparent blocks [PR119547]"
    for a different yet related issue.

    Reported-by: Heinrich Schuchardt <heinrich.schucha...@canonical.com>
    Signed-off-by: Vineet Gupta <vine...@rivosinc.com>

            PR target/119533

    gcc/ChangeLog:

            * config/riscv/riscv-vsetvl.cc (invalid_opt_bb_p): Check for
            EDGE_ABNOMAL.
            (pre_vsetvl::compute_lcm_local_properties): Initialize kill
            bitmap.
            Debug dump skipped edge.

    gcc/testsuite/ChangeLog:

            * go.dg/pr119533-riscv.go: New test.
            * go.dg/pr119533-riscv-2.go: New test.

Reply via email to