[all-commits] [llvm/llvm-project] e13e80: [SROA] Limit the number of allowed slices when try...

Dhruv Chawla via All-commits all-commits at lists.llvm.org
Fri Sep 8 22:31:57 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: e13e808283f7fd9e873ae922dd1ef61aeaa0eb4a
      https://github.com/llvm/llvm-project/commit/e13e808283f7fd9e873ae922dd1ef61aeaa0eb4a
  Author: Dhruv Chawla <44582521+dc03 at users.noreply.github.com>
  Date:   2023-09-09 (Sat, 09 Sep 2023)

  Changed paths:
    M llvm/lib/Transforms/Scalar/SROA.cpp
    A llvm/test/Transforms/SROA/huge-size.ll

  Log Message:
  -----------
  [SROA] Limit the number of allowed slices when trying to split allocas

This patch adds a hidden CLI option "--sroa-max-alloca-slices", which is
an integer that controls the maximum number of alloca slices SROA can
consider before bailing out. This is useful because it may not be
profitable to split memcpys into (possibly tens of) thousands of loads/stores.
This also prevents an issue with exponential compile time explosion in passes
like DSE and MemCpyOpt caused by excessive alloca splitting.

Fixes https://github.com/rust-lang/rust/issues/88580.

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




More information about the All-commits mailing list