[RelLookupTableConverter] Avoid querying TTI for declarations
authorNikita Popov <npopov@redhat.com>
Wed, 16 Mar 2022 09:36:00 +0000 (10:36 +0100)
committerNikita Popov <npopov@redhat.com>
Wed, 16 Mar 2022 09:39:28 +0000 (10:39 +0100)
commit20531b3a6b091b8dd2e3992aec11ac10581e91e2
treea131588ee8476dc41ef45fe84d90bf34f6281581
parent09854f2af3b914b616f29cb640bede3a27cf7c4e
[RelLookupTableConverter] Avoid querying TTI for declarations

This code queries TTI on a single function, which is considered to
be representative. This is a bit odd, but probably fine in practice.

However, I think we should at least avoid querying declarations,
which e.g. will generally lack target attributes, and for which
we don't seem to ever query TTI in other places.
llvm/lib/Transforms/Utils/RelLookupTableConverter.cpp