[all-commits] [llvm/llvm-project] 5da431: [MLIR][LLVM] Always print variadic callee type (#9...

Tobias Gysi via All-commits all-commits at lists.llvm.org
Mon Jul 22 23:22:07 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5da431008222e2653f618f3a112af58a94417251
      https://github.com/llvm/llvm-project/commit/5da431008222e2653f618f3a112af58a94417251
  Author: Tobias Gysi <tobias.gysi at nextsilicon.com>
  Date:   2024-07-23 (Tue, 23 Jul 2024)

  Changed paths:
    M mlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
    M mlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
    M mlir/test/Dialect/LLVMIR/invalid.mlir

  Log Message:
  -----------
  [MLIR][LLVM] Always print variadic callee type (#99293)

This commit updates the LLVM dialect CallOp and InvokeOp to always print
the variadic callee type (previously callee type) if present. An
additional verifier checks that only variadic calls have a non-null
variadic callee type, and the builders are adapted accordingly to set
the variadic callee type for variadic calls only. Finally, the CallOp
and InvokeOp verifiers are strengthened to check that the variadic
callee type matches the call argument and result types.

The motivation of this change is that CallOp and InvokeOp don't have
hidden state that is not pretty printed, but used during the export to
LLVM IR. Previously, it could happen that a call looked correct in MLIR,
but the return type changed after exporting to LLVM IR (since it has
been taken from the hidden callee type attribute). After landing this
change, this is not possible anymore since the variadic callee type is
always printed if present.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list