mirror of
https://github.com/intel/llvm.git
synced 2026-01-25 10:55:58 +08:00
[mlir] Remove static constructors from LLVMType
LLVMType contains numerous static constructors that were initially introduced for API compatibility with LLVM. Most of these merely forward to arguments to `SpecificType::get` (MLIR defines classes for all types, unlike LLVM IR), while some introduce subtle semantics differences due to different modeling of MLIR types (e.g., structs are not auto-renamed in case of conflicts). Furthermore, these constructors don't match MLIR idioms and actively prevent us from making the LLVM dialect type system more open. Remove them and use `SpecificType::get` instead. Depends On D93680 Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D93681
This commit is contained in:
@@ -769,13 +769,12 @@ LogicalResult ModuleTranslation::convertOperation(Operation &opInst,
|
||||
|
||||
LLVM::LLVMType resultType;
|
||||
if (inlineAsmOp.getNumResults() == 0) {
|
||||
resultType = LLVM::LLVMType::getVoidTy(mlirModule->getContext());
|
||||
resultType = LLVM::LLVMVoidType::get(mlirModule->getContext());
|
||||
} else {
|
||||
assert(inlineAsmOp.getNumResults() == 1);
|
||||
resultType = inlineAsmOp.getResultTypes()[0].cast<LLVM::LLVMType>();
|
||||
}
|
||||
auto ft = LLVM::LLVMType::getFunctionTy(resultType, operandTypes,
|
||||
/*isVarArg=*/false);
|
||||
auto ft = LLVM::LLVMFunctionType::get(resultType, operandTypes);
|
||||
llvm::InlineAsm *inlineAsmInst =
|
||||
inlineAsmOp.asm_dialect().hasValue()
|
||||
? llvm::InlineAsm::get(
|
||||
|
||||
Reference in New Issue
Block a user