[all-commits] [llvm/llvm-project] a722e2: [GlobalOpt] Don't evaluate large memset (PR62191)

Nikita Popov via All-commits all-commits at lists.llvm.org
Tue Apr 18 09:24:34 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: a722e2366bede3d476c5bf3ff11428102aa4891f
      https://github.com/llvm/llvm-project/commit/a722e2366bede3d476c5bf3ff11428102aa4891f
  Author: Nikita Popov <npopov at redhat.com>
  Date:   2023-04-18 (Tue, 18 Apr 2023)

  Changed paths:
    M llvm/lib/Transforms/Utils/Evaluator.cpp
    M llvm/test/Transforms/GlobalOpt/ctor-memset.ll

  Log Message:
  -----------
  [GlobalOpt] Don't evaluate large memset (PR62191)

If the memset is large, checking every single byte of the global
may be very slow. Add an upper bound on the size of memset we
handle.

For the common special case of memset zeroinitializer to zero,
add a fastpath that checks just that and is not length limited.

Fixes https://github.com/llvm/llvm-project/issues/62191.




More information about the All-commits mailing list