[all-commits] [llvm/llvm-project] 784e01: [IR] Require matching signature in getCalledFuncti...

Nikita Popov via All-commits all-commits at lists.llvm.org
Sat Jan 29 01:01:40 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 784e01abca65722df8969b56d2d240cf9ced9c85
      https://github.com/llvm/llvm-project/commit/784e01abca65722df8969b56d2d240cf9ced9c85
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2022-01-29 (Sat, 29 Jan 2022)

  Changed paths:
    M llvm/include/llvm/IR/InstrTypes.h
    A llvm/test/Transforms/InstSimplify/known-non-zero-opaque-ptrs.ll

  Log Message:
  -----------
  [IR] Require matching signature in getCalledFunction()

With opaque pointers, it's possible to directly call a function with
a different signature, without an intermediate bitcast. However,
lot's of code using getCalledFunction() reasonably assumes that the
signatures match (which is always true without opaque pointers).
Add an explicit check to that effect.

The test case is from D105313, where I ran into the problem, but on
further investigation this also affects lots of other code, we just
have little coverage with mismatching signatures. The change from
D105313 is still desirable for other reasons, but this patch
addresses the root problem when it comes to opaque pointers.

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




More information about the All-commits mailing list