[MemoryBuiltins] Don't query TLI for non-pointer functions (NFC)
authorNikita Popov <npopov@redhat.com>
Thu, 21 Jul 2022 08:46:50 +0000 (10:46 +0200)
committerNikita Popov <npopov@redhat.com>
Thu, 21 Jul 2022 09:28:36 +0000 (11:28 +0200)
commit235fb602ed99c59f2a741533906c19280d791e18
tree741c48c5915bd94292d6f8877bde2eb9189c1cad
parentea623af7c90f0c02fed72010a018cb1e259cca8d
[MemoryBuiltins] Don't query TLI for non-pointer functions (NFC)

Fetching allocation data for calls is a rather hot operation, and
TLI lookups are slow. We can greatly reduce the number of calls
for which TLI is queried by checking that they return a pointer
value first, as this is a requirement for allocation functions
anyway.
llvm/lib/Analysis/MemoryBuiltins.cpp