[llvm-bugs] [Bug 51791] New: [MemCpyOpt] Merge 7fb66d4035960b3c2797eae73d79b8478ff0348e into 13.0.0

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Sep 8 04:48:02 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=51791

            Bug ID: 51791
           Summary: [MemCpyOpt] Merge
                    7fb66d4035960b3c2797eae73d79b8478ff0348e into 13.0.0
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: Scalar Optimizations
          Assignee: unassignedbugs at nondot.org
          Reporter: fraser at codeplay.com
                CC: llvm-bugs at lists.llvm.org
            Blocks: 51236

This patch fixes crashes on IR written with fairly simple code containing
scalable vector types. It's not a blocker but it'd be nice for us to have as we
are triggering this assertion in our downstream project.

Note that the actual patch in-tree depends on
17db125b487faa69d789b80d47b19da49522b168 which is just an optimization and
hasn't been merged into 13.0.0 (I don't think).

Therefore I created
https://github.com/frasercrmck/llvm-project/tree/scalable-memcpyopt which has
cherry-picked the patch onto the release branch. I ran check-llvm which passes.
Hopefully that makes things simpler for you.

commit 7fb66d4035960b3c2797eae73d79b8478ff0348e (HEAD -> main, origin/main)
Author: Fraser Cormack <fraser at codeplay.com>
Date:   Mon Sep 6 16:56:12 2021 +0100

    [MemCpyOpt] Fix a variety of scalable-type crashes

    This patch fixes a variety of crashes resulting from the `MemCpyOptPass`
    casting `TypeSize` to a constant integer, whether implicitly or
    explicitly.

    Since the `MemsetRanges` requires a constant size to work, all but one
    of the fixes in this patch simply involve skipping the various
    optimizations for scalable types as cleanly as possible.

    The optimization of `byval` parameters, however, has been updated to
    work on scalable types in theory. In practice, this optimization is only
    valid when the length of the `memcpy` is known to be larger than the
    scalable type size, which is currently never the case. This could
    perhaps be done in the future using the `vscale_range` attribute.

    Some implicit casts have been left as they were, under the knowledge
    they are only called on aggregate types. These should never be
    scalably-sized.

    Reviewed By: nikic, tra

    Differential Revision: https://reviews.llvm.org/D109329


Referenced Bugs:

https://bugs.llvm.org/show_bug.cgi?id=51236
[Bug 51236] [meta] 13.0.0 Release Blockers
-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20210908/da4900ce/attachment.html>


More information about the llvm-bugs mailing list