[InlineCost] Check that function types match
authorNikita Popov <npopov@redhat.com>
Tue, 12 Apr 2022 09:03:42 +0000 (11:03 +0200)
committerNikita Popov <npopov@redhat.com>
Tue, 12 Apr 2022 09:05:33 +0000 (11:05 +0200)
commit8d5c8d57c637d898094af323d1888ea5a3364f8c
tree57342b72a11a6f5a2fad12aa744f13965c21139d
parentdbd80d7d27866a6ca709e032394985a3cb0fcadf
[InlineCost] Check that function types match

Retain the behavior we get without opaque pointers: A call to a
known function with different function type is considered an
indirect call.

This fixes the crash reported in https://reviews.llvm.org/D123300#3444772.
llvm/lib/Analysis/InlineCost.cpp
llvm/test/Transforms/Inline/opaque-ptr.ll [new file with mode: 0644]