[llvm] TargetLibraryInfo: Assume no libcalls in the default constructor (PR #92400)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 07:51:59 PDT 2024


================
@@ -882,11 +885,19 @@ static void initialize(TargetLibraryInfoImpl &TLI, const Triple &T,
   TLI.addVectorizableFunctionsFromVecLib(ClVectorLibrary, T);
 }
 
-TargetLibraryInfoImpl::TargetLibraryInfoImpl() {
-  // Default to everything being available.
-  memset(AvailableArray, -1, sizeof(AvailableArray));
----------------
arsenm wrote:

The default constructed TLI should never be used. It shouldn't be possible to construct one without a triple, but there are places where one is default constructed and never used.

The ideal follow up change would be to not make anything available with an unknown target in the real constructor 

https://github.com/llvm/llvm-project/pull/92400


More information about the llvm-commits mailing list