[PATCH] D56720: [MemorySSA] Add caching results of reaching LiveOnEntry MemoryDef to ClobberWalker

Evgeny Astigeevich via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 15 07:02:45 PST 2019


eastig created this revision.
eastig added reviewers: george.burgess.iv, asbirlea, davide.
Herald added subscribers: kristof.beyls, Prazek, javed.absar.

There is the project VIXL (https://git.linaro.org/arm/vixl.git), AArch32 and AArch64 Runtime Code Generation Library. The library is used by such projects as AOSP and HHVM. The library has C++ sources which trigger quadratic running time in MemorySSA.
For example, the compilation time of https://git.linaro.org/arm/vixl.git/tree/test/aarch32/test-assembler-cond-rd-operand-rn-in-it-block-t32.cc is 5 minutes. G++ 5.4 compiles it in 17 seconds. The file contains a big global array of structs for which an initialiser is generated. The issue was found by Google. At the moment a workaround to turn optimisations off for the sources is used: https://android.googlesource.com/platform/external/vixl/+/master/test/aarch32/test-utils-aarch32.h.

This patch is a prototype of caching some results in ClobberWalker. The idea of caching is based on a pattern I have seen. When there is a walk path leading to a LiveOnEntry MemoryDef its result can be reused as soon as we get on the path again.

The patch reduces the compilation time from 5 minutes to 25 seconds.
Command to reproduce:

  clang++ -c -Wall -Werror -fdiagnostics-show-option -Wextra -Wredundant-decls -pedantic -Wwrite-strings -Wunused -DVIXL_INCLUDE_TARGET_A32 -DVIXL_INCLUDE_TARGET_T32 -DVIXL_INCLUDE_TARGET_A64 -O3 -DVIXL_CODE_BUFFER_MMAP -DVIXL_INCLUDE_SIMULATOR_AARCH64 -Wmissing-noreturn  -Wunreachable-code -Wno-long-long -Wno-variadic-macros -Isrc -Itest test/aarch32/test-assembler-cond-rd-operand-rn-in-it-block-t32.cc

Testing results:

1. check-all passed
2. VIXL tests passed
3. Bootstrapped clang
  1. check-all passed
  2. VIXL tests passed


Repository:
  rL LLVM

https://reviews.llvm.org/D56720

Files:
  lib/Analysis/MemorySSA.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D56720.181770.patch
Type: text/x-patch
Size: 7613 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190115/0d39e3e3/attachment.bin>


More information about the llvm-commits mailing list