def METHOD_NAME(mlir_module: builtin.ModuleOp, opts: CompileToMlirOpts):
    lowering_options = [
        f"locationInfoStyle={opts.location_info_style}",
    ]
    if opts.explicit_bitcast:
        lowering_options.append("explicitBitcast")
    if opts.disallow_expression_inlining_in_ports:
        lowering_options.append("disallowExpressionInliningInPorts")
    if opts.disallow_local_variables:
        lowering_options.append("disallowLocalVariables")
    if opts.omit_version_comment:
        lowering_options.append("omitVersionComment")
    if lowering_options:
        mlir_module.attr_dict["circt.loweringOptions"] = builtin.StringAttr(
            f"{','.join(lowering_options)}"
        )