llvm / llvm/llvm-project

[CIR] CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp why?

Closed
#222,057 1 comment 0 reactions 0 assignees View on GitHub
new issue
Dominant language
LLVM
Stars
40.5k
Forks
18.7k
PR merge metrics
PR metrics pending

Description

```
/home/beeehioo/toolchains_build/llvm-project/llvm/../mlir/include/mlir/IR/PatternMatch.h:532:21: error: no matching function for call to 'mlir::LLVM::InlineAsmOp::create(mlir::OpBuilder&, mlir::Location, mlir::Type&, llvm::SmallVector&, mlir::StringAttr, mlir::StringAttr, mlir::UnitAttr, mlir::UnitAttr, mlir::LLVM::TailCallKindAttr, mlir::LLVM::AsmDialectAttr, mlir::ArrayAttr)'
532 | OpTy::create(*builder, op->getLoc(), std::forward(args)...);
| ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
• there are 12 candidates
• candidate 1: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::ImplicitLocOpBuilder&, mlir::Type, mlir::ValueRange, mlir::StringAttr, mlir::StringAttr, mlir::UnitAttr, mlir::UnitAttr, mlir::LLVM::TailCallKindAttr, mlir::UnitAttr, mlir::LLVM::AsmDialectAttr, mlir::ArrayAttr)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15500:22:
15500 | static InlineAsmOp create(::mlir::ImplicitLocOpBuilder &builder, /*optional*/::mlir::Type res, ::mlir::ValueRange operands, ::mlir::StringAttr asm_string, ::mlir::StringAttr constraints, /*optional*/::mlir::UnitAttr has_side_effects, /*optional*/::mlir::UnitAttr is_align_stack, ::mlir::LLVM::TailCallKindAttr tail_call_kind, /*optional*/::mlir::UnitAttr convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ^~~~~~
• no known conversion for argument 1 from 'mlir::OpBuilder' to 'mlir::ImplicitLocOpBuilder&'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15500:59:
15500 | static InlineAsmOp create(::mlir::ImplicitLocOpBuilder &builder, /*optional*/::mlir::Type res, ::mlir::ValueRange operands, ::mlir::StringAttr asm_string, ::mlir::StringAttr constraints, /*optional*/::mlir::UnitAttr has_side_effects, /*optional*/::mlir::UnitAttr is_align_stack, ::mlir::LLVM::TailCallKindAttr tail_call_kind, /*optional*/::mlir::UnitAttr convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
• candidate 2: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::ImplicitLocOpBuilder&, mlir::TypeRange, mlir::ValueRange, mlir::StringAttr, mlir::StringAttr, mlir::UnitAttr, mlir::UnitAttr, mlir::LLVM::TailCallKindAttr, mlir::UnitAttr, mlir::LLVM::AsmDialectAttr, mlir::ArrayAttr)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15503:22:
15503 | static InlineAsmOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::mlir::StringAttr asm_string, ::mlir::StringAttr constraints, /*optional*/::mlir::UnitAttr has_side_effects, /*optional*/::mlir::UnitAttr is_align_stack, ::mlir::LLVM::TailCallKindAttr tail_call_kind, /*optional*/::mlir::UnitAttr convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ^~~~~~
• no known conversion for argument 1 from 'mlir::OpBuilder' to 'mlir::ImplicitLocOpBuilder&'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15503:59:
15503 | static InlineAsmOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::mlir::StringAttr asm_string, ::mlir::StringAttr constraints, /*optional*/::mlir::UnitAttr has_side_effects, /*optional*/::mlir::UnitAttr is_align_stack, ::mlir::LLVM::TailCallKindAttr tail_call_kind, /*optional*/::mlir::UnitAttr convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
• candidate 3: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::ImplicitLocOpBuilder&, mlir::Type, mlir::ValueRange, llvm::StringRef, llvm::StringRef, bool, bool, mlir::LLVM::tailcallkind::TailCallKind, bool, mlir::LLVM::AsmDialectAttr, mlir::ArrayAttr)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15506:22:
15506 | static InlineAsmOp create(::mlir::ImplicitLocOpBuilder &builder, /*optional*/::mlir::Type res, ::mlir::ValueRange operands, ::llvm::StringRef asm_string, ::llvm::StringRef constraints, /*optional*/bool has_side_effects, /*optional*/bool is_align_stack, ::mlir::LLVM::tailcallkind::TailCallKind tail_call_kind, /*optional*/bool convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ^~~~~~
• no known conversion for argument 1 from 'mlir::OpBuilder' to 'mlir::ImplicitLocOpBuilder&'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15506:59:
15506 | static InlineAsmOp create(::mlir::ImplicitLocOpBuilder &builder, /*optional*/::mlir::Type res, ::mlir::ValueRange operands, ::llvm::StringRef asm_string, ::llvm::StringRef constraints, /*optional*/bool has_side_effects, /*optional*/bool is_align_stack, ::mlir::LLVM::tailcallkind::TailCallKind tail_call_kind, /*optional*/bool convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
• candidate 4: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::ImplicitLocOpBuilder&, mlir::TypeRange, mlir::ValueRange, llvm::StringRef, llvm::StringRef, bool, bool, mlir::LLVM::tailcallkind::TailCallKind, bool, mlir::LLVM::AsmDialectAttr, mlir::ArrayAttr)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15509:22:
15509 | static InlineAsmOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::StringRef asm_string, ::llvm::StringRef constraints, /*optional*/bool has_side_effects, /*optional*/bool is_align_stack, ::mlir::LLVM::tailcallkind::TailCallKind tail_call_kind, /*optional*/bool convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ^~~~~~
• no known conversion for argument 1 from 'mlir::OpBuilder' to 'mlir::ImplicitLocOpBuilder&'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15509:59:
15509 | static InlineAsmOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::StringRef asm_string, ::llvm::StringRef constraints, /*optional*/bool has_side_effects, /*optional*/bool is_align_stack, ::mlir::LLVM::tailcallkind::TailCallKind tail_call_kind, /*optional*/bool convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
• candidate 5: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::OpBuilder&, mlir::Location, mlir::Type, mlir::ValueRange, mlir::StringAttr, mlir::StringAttr, mlir::UnitAttr, mlir::UnitAttr, mlir::LLVM::TailCallKindAttr, mlir::UnitAttr, mlir::LLVM::AsmDialectAttr, mlir::ArrayAttr)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15499:22:
15499 | static InlineAsmOp create(::mlir::OpBuilder &builder, ::mlir::Location location, /*optional*/::mlir::Type res, ::mlir::ValueRange operands, ::mlir::StringAttr asm_string, ::mlir::StringAttr constraints, /*optional*/::mlir::UnitAttr has_side_effects, /*optional*/::mlir::UnitAttr is_align_stack, ::mlir::LLVM::TailCallKindAttr tail_call_kind, /*optional*/::mlir::UnitAttr convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ^~~~~~
• candidate expects 12 arguments, 11 provided
• candidate 6: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::OpBuilder&, mlir::Location, mlir::TypeRange, mlir::ValueRange, mlir::StringAttr, mlir::StringAttr, mlir::UnitAttr, mlir::UnitAttr, mlir::LLVM::TailCallKindAttr, mlir::UnitAttr, mlir::LLVM::AsmDialectAttr, mlir::ArrayAttr)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15502:22:
15502 | static InlineAsmOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::mlir::StringAttr asm_string, ::mlir::StringAttr constraints, /*optional*/::mlir::UnitAttr has_side_effects, /*optional*/::mlir::UnitAttr is_align_stack, ::mlir::LLVM::TailCallKindAttr tail_call_kind, /*optional*/::mlir::UnitAttr convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ^~~~~~
• candidate expects 12 arguments, 11 provided
• candidate 7: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::OpBuilder&, mlir::Location, mlir::Type, mlir::ValueRange, llvm::StringRef, llvm::StringRef, bool, bool, mlir::LLVM::tailcallkind::TailCallKind, bool, mlir::LLVM::AsmDialectAttr, mlir::ArrayAttr)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15505:22:
15505 | static InlineAsmOp create(::mlir::OpBuilder &builder, ::mlir::Location location, /*optional*/::mlir::Type res, ::mlir::ValueRange operands, ::llvm::StringRef asm_string, ::llvm::StringRef constraints, /*optional*/bool has_side_effects, /*optional*/bool is_align_stack, ::mlir::LLVM::tailcallkind::TailCallKind tail_call_kind, /*optional*/bool convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ^~~~~~
• candidate expects 12 arguments, 11 provided
• candidate 8: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::OpBuilder&, mlir::Location, mlir::TypeRange, mlir::ValueRange, llvm::StringRef, llvm::StringRef, bool, bool, mlir::LLVM::tailcallkind::TailCallKind, bool, mlir::LLVM::AsmDialectAttr, mlir::ArrayAttr)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15508:22:
15508 | static InlineAsmOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::StringRef asm_string, ::llvm::StringRef constraints, /*optional*/bool has_side_effects, /*optional*/bool is_align_stack, ::mlir::LLVM::tailcallkind::TailCallKind tail_call_kind, /*optional*/bool convergent, /*optional*/::mlir::LLVM::AsmDialectAttr asm_dialect, /*optional*/::mlir::ArrayAttr operand_attrs);
| ^~~~~~
• candidate expects 12 arguments, 11 provided
• candidate 9: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::OpBuilder&, mlir::Location, mlir::TypeRange, mlir::ValueRange, llvm::ArrayRef)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15511:22:
15511 | static InlineAsmOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
| ^~~~~~
• candidate expects 5 arguments, 11 provided
• candidate 10: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::ImplicitLocOpBuilder&, mlir::TypeRange, mlir::ValueRange, llvm::ArrayRef)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15512:22:
15512 | static InlineAsmOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
| ^~~~~~
• candidate expects 4 arguments, 11 provided
• candidate 11: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::OpBuilder&, mlir::Location, mlir::TypeRange, mlir::ValueRange, const Properties&, llvm::ArrayRef)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15514:22:
15514 | static InlineAsmOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
| ^~~~~~
• candidate expects 6 arguments, 11 provided
• candidate 12: 'static mlir::LLVM::InlineAsmOp mlir::LLVM::InlineAsmOp::create(mlir::ImplicitLocOpBuilder&, mlir::TypeRange, mlir::ValueRange, const Properties&, llvm::ArrayRef)'
/home/beeehioo/toolchains_build/llvm_build/tools/mlir/include/mlir/Dialect/LLVMIR/LLVMOps.h.inc:15515:22:
15515 | static InlineAsmOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
| ^~~~~~
• candidate expects 5 arguments, 11 provided
/home/beeehioo/toolchains_build/llvm-project/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp: In function 'mlir::LLVM::Visibility cir::direct::lowerCIRVisibilityToLLVMVisibility(cir::VisibilityKind)':
/home/beeehioo/toolchains_build/llvm-project/clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp:138:1: warning: control reaches end of non-void function [-Wreturn-type]
138 | }
| ^

```

Contributor guide

Open the contributing guide

Research direction

Start in CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp and compare the InlineAsmOp::create call with the declarations in the generated mlir/Dialect/LLVMIR/LLVMOps.h.inc shown by the diagnostic. Reproduce the reported build and trace the argument mismatch; done means the CIR DirectToLLVM build no longer produces this error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.