HomePhabricator

[PredicateInfo] Use Intrinsic::getDeclaration now that it handles unnamed types.

Authored by jeroen.dobbelaere on Jul 28 2021, 9:56 AM.

Description

[PredicateInfo] Use Intrinsic::getDeclaration now that it handles unnamed types.

This is a second attempt to fix the EXPENSIVE_CHECKS issue that was mentioned In D91661#2875179 by @jroelofs.

(The first attempt was in D105983)

D91661 more or less completely reverted D49126 and by doing so also removed the cleanup logic of the created declarations and calls.
This patch is a replacement for D91661 (which must itself be reverted first). It replaces the custom declaration creation with the
generic version and shows the test impact. It also tracks the number of NamedValues to detect if a new prototype was added instead
of looking at the available users of a prototype.

Reviewed By: jroelofs

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