[all-commits] [llvm/llvm-project] 4d188a: [Verifier] Require same signature for intrinsic calls

Nikita Popov via All-commits all-commits at lists.llvm.org
Fri Jul 16 09:33:33 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4d188a6524083ef79dae910215d4b34fad595358
      https://github.com/llvm/llvm-project/commit/4d188a6524083ef79dae910215d4b34fad595358
  Author: Nikita Popov <nikita.ppv at gmail.com>
  Date:   2021-07-16 (Fri, 16 Jul 2021)

  Changed paths:
    M llvm/lib/IR/Verifier.cpp
    A llvm/test/Verifier/force-opaque-ptr.ll

  Log Message:
  -----------
  [Verifier] Require same signature for intrinsic calls

As suggested on D105733, this adds a verifier rule that calls to
intrinsics must match the signature of the intrinsic.

Without opaque pointers this is automatically enforced for all
calls, because the pointer types need to match. If the signatures
don't match, a pointer bitcast has to be inserted. For intrinsics
in particular, such bitcasts are not legal, because the address of
intrinsics cannot be taken.

With opaque pointers, there are no more pointer bitcasts, so it's
generally possible for the call and the callee signature to differ.
However, for intrinsics we still want to enforce that the signatures
must match, the same as was done before through the address taken
check.

We can't enforce this more generally for non-intrinsics, because
calls with mismatched signatures at the very least can legally
occur in unreachable code, and might also be valid in some other
cases, depending on how exactly the signatures differ.

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




More information about the All-commits mailing list