192233062Smax# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 292233062Smax# See https://llvm.org/LICENSE.txt for license information. 392233062Smax# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 492233062Smax 592233062Smaxfrom ._llvm_ops_gen import * 692233062Smaxfrom ._llvm_enum_gen import * 7bd8fcf75SOleksandr "Alex" Zinenkofrom .._mlir_libs._mlirDialectsLLVM import * 8*79d4d165SMaksim Leventalfrom ..ir import Value 9*79d4d165SMaksim Leventalfrom ._ods_common import get_op_result_or_op_results as _get_op_result_or_op_results 10*79d4d165SMaksim Levental 11*79d4d165SMaksim Levental 12*79d4d165SMaksim Leventaldef mlir_constant(value, *, loc=None, ip=None) -> Value: 13*79d4d165SMaksim Levental return _get_op_result_or_op_results( 14*79d4d165SMaksim Levental ConstantOp(res=value.type, value=value, loc=loc, ip=ip) 15*79d4d165SMaksim Levental ) 16