[PredicateInfo] Factor out PredicateInfoBuilder (NFC)
authorNikita Popov <nikita.ppv@gmail.com>
Thu, 16 Apr 2020 20:22:14 +0000 (22:22 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Sat, 18 Apr 2020 20:34:38 +0000 (22:34 +0200)
commita42fd18d0f7d753eb495650d040a3fe0837dba6b
treed0d719da4b8d562fc7f5a62290dd6c9f72a36dc9
parent44d63b7528e4142bda9f3daba9c11cb460cb7d77
[PredicateInfo] Factor out PredicateInfoBuilder (NFC)

When running IPSCCP on a module with many small functions, memory
usage is dominated by PredicateInfo, which is a huge structure
(partially due to some unfortunate nested SmallVector use). However,
most of it is actually only temporary state needed to build
predicate info, and does not need to be retained after initial
construction.

This patch factors out the predicate building logic and state
into a separate PrediceInfoBuilder, with the extra bonus that
it does not need to live in the header anymore.

Differential Revision: https://reviews.llvm.org/D78326
llvm/include/llvm/Transforms/Utils/PredicateInfo.h
llvm/lib/Transforms/Utils/PredicateInfo.cpp