未验证 提交 8670df60 编写于 作者: L Leo Chen 提交者: GitHub

increase some log level in ir to avoid too much log (#54947)

上级 af127342
......@@ -56,7 +56,7 @@ class IrContextImpl {
void RegisterAbstractType(ir::TypeId type_id, AbstractType *abstract_type) {
std::lock_guard<ir::SpinLock> guard(registed_abstract_types_lock_);
VLOG(4) << "Register an abstract_type of: [TypeId_hash="
VLOG(6) << "Register an abstract_type of: [TypeId_hash="
<< std::hash<ir::TypeId>()(type_id)
<< ", AbstractType_ptr=" << abstract_type << "].";
registed_abstract_types_.emplace(type_id, abstract_type);
......@@ -66,7 +66,7 @@ class IrContextImpl {
std::lock_guard<ir::SpinLock> guard(registed_abstract_types_lock_);
auto iter = registed_abstract_types_.find(type_id);
if (iter != registed_abstract_types_.end()) {
VLOG(4) << "Found a cached abstract_type of: [TypeId_hash="
VLOG(6) << "Found a cached abstract_type of: [TypeId_hash="
<< std::hash<ir::TypeId>()(type_id)
<< ", AbstractType_ptr=" << iter->second << "].";
return iter->second;
......@@ -79,7 +79,7 @@ class IrContextImpl {
void RegisterAbstractAttribute(ir::TypeId type_id,
AbstractAttribute *abstract_attribute) {
std::lock_guard<ir::SpinLock> guard(registed_abstract_attributes_lock_);
VLOG(4) << "Register an abstract_attribute of: [TypeId_hash="
VLOG(6) << "Register an abstract_attribute of: [TypeId_hash="
<< std::hash<ir::TypeId>()(type_id)
<< ", AbstractAttribute_ptr=" << abstract_attribute << "].";
registed_abstract_attributes_.emplace(type_id, abstract_attribute);
......@@ -105,7 +105,7 @@ class IrContextImpl {
void RegisterOpInfo(const std::string &name, OpInfo info) {
std::lock_guard<ir::SpinLock> guard(registed_op_infos_lock_);
VLOG(4) << "Register an operation of: [Name=" << name
VLOG(6) << "Register an operation of: [Name=" << name
<< ", OpInfo ptr=" << info.AsOpaquePointer() << "].";
registed_op_infos_.emplace(name, info);
}
......@@ -114,7 +114,7 @@ class IrContextImpl {
std::lock_guard<ir::SpinLock> guard(registed_op_infos_lock_);
auto iter = registed_op_infos_.find(name);
if (iter != registed_op_infos_.end()) {
VLOG(4) << "Found a cached OpInfo of: [name=" << name
VLOG(8) << "Found a cached OpInfo of: [name=" << name
<< ", OpInfo: ptr=" << iter->second.AsOpaquePointer() << "].";
return iter->second;
}
......@@ -125,7 +125,7 @@ class IrContextImpl {
void RegisterDialect(std::string name, Dialect *dialect) {
std::lock_guard<ir::SpinLock> guard(registed_dialect_lock_);
VLOG(4) << "Register a dialect of: [name=" << name
VLOG(6) << "Register a dialect of: [name=" << name
<< ", dialect_ptr=" << dialect << "].";
registed_dialect_.emplace(name, dialect);
}
......@@ -138,7 +138,7 @@ class IrContextImpl {
std::lock_guard<ir::SpinLock> guard(registed_dialect_lock_);
auto iter = registed_dialect_.find(name);
if (iter != registed_dialect_.end()) {
VLOG(4) << "Found a cached dialect of: [name=" << name
VLOG(6) << "Found a cached dialect of: [name=" << name
<< ", dialect_ptr=" << iter->second << "].";
return iter->second;
}
......@@ -225,7 +225,6 @@ void IrContext::RegisterAbstractAttribute(
if (GetRegisteredAbstractAttribute(type_id) == nullptr) {
impl().RegisterAbstractAttribute(
type_id, new AbstractAttribute(std::move(abstract_attribute)));
VLOG(4) << "<--- Attribute registered into IrContext. --->";
} else {
LOG(WARNING) << " Attribute already registered.";
}
......@@ -278,7 +277,6 @@ void IrContext::RegisterAbstractType(ir::TypeId type_id,
if (GetRegisteredAbstractType(type_id) == nullptr) {
impl().RegisterAbstractType(type_id,
new AbstractType(std::move(abstract_type)));
VLOG(4) << "<--- Type registered into IrContext. --->";
} else {
LOG(WARNING) << " type already registered.";
}
......@@ -304,7 +302,6 @@ void IrContext::RegisterOpInfo(Dialect *dialect,
attributes_name,
verify);
impl().RegisterOpInfo(name, info);
VLOG(4) << name << " op registered into IrContext. --->";
}
}
......
......@@ -152,7 +152,7 @@ class ConstructInterfacesOrTraits {
static void PlacementConstrctInterface(
InterfaceValue *&p_interface) { // NOLINT
p_interface->swap(InterfaceValue::get<ConcreteOp, T>());
VLOG(4) << "New a interface: id["
VLOG(6) << "New a interface: id["
<< (p_interface->type_id()).AsOpaquePointer() << "].";
++p_interface;
}
......@@ -161,7 +161,7 @@ class ConstructInterfacesOrTraits {
template <typename T>
static void PlacementConstrctTrait(ir::TypeId *&p_trait) { // NOLINT
*p_trait = TypeId::get<T>();
VLOG(4) << "New a trait: id[" << p_trait->AsOpaquePointer() << "].";
VLOG(6) << "New a trait: id[" << p_trait->AsOpaquePointer() << "].";
++p_trait;
}
};
......
......@@ -27,12 +27,12 @@ OpInfo OpInfoImpl::Create(Dialect *dialect,
// (1) Malloc memory for interfaces, traits, opinfo_impl.
size_t interfaces_num = interface_map.size();
size_t traits_num = trait_set.size();
VLOG(4) << "Create OpInfoImpl with: " << interfaces_num << " interfaces, "
VLOG(6) << "Create OpInfoImpl with: " << interfaces_num << " interfaces, "
<< traits_num << " traits, " << attributes_num << " attributes.";
size_t base_size = sizeof(InterfaceValue) * interfaces_num +
sizeof(TypeId) * traits_num + sizeof(OpInfoImpl);
char *base_ptr = static_cast<char *>(::operator new(base_size));
VLOG(4) << "Malloc " << base_size << " Bytes at "
VLOG(6) << "Malloc " << base_size << " Bytes at "
<< static_cast<void *>(base_ptr);
if (interfaces_num > 0) {
std::sort(interface_map.begin(), interface_map.end());
......@@ -49,7 +49,7 @@ OpInfo OpInfoImpl::Create(Dialect *dialect,
base_ptr += traits_num * sizeof(TypeId);
}
// Construct OpInfoImpl.
VLOG(4) << "Construct OpInfoImpl at " << base_ptr << " ......";
VLOG(6) << "Construct OpInfoImpl at " << base_ptr << " ......";
OpInfo op_info = OpInfo(new (base_ptr) OpInfoImpl(dialect,
op_id,
op_name,
......@@ -120,7 +120,7 @@ void *OpInfoImpl::GetInterfaceImpl(TypeId interface_id) const {
}
void OpInfoImpl::Destroy() {
VLOG(4) << "Destroy op_info impl at " << this;
VLOG(6) << "Destroy op_info impl at " << this;
// (1) free interfaces
char *base_ptr = reinterpret_cast<char *>(this) -
sizeof(ir::TypeId) * num_traits_ -
......@@ -133,7 +133,7 @@ void OpInfoImpl::Destroy() {
}
}
// (2) free memeory
VLOG(4) << "Free base_ptr " << base_ptr;
VLOG(6) << "Free base_ptr " << reinterpret_cast<void *>(base_ptr);
free(base_ptr);
}
......
......@@ -44,7 +44,7 @@ struct ParametricStorageManager {
auto pr = parametric_instances_.equal_range(hash_value);
while (pr.first != pr.second) {
if (equal_func(pr.first->second)) {
VLOG(4) << "Found a cached parametric storage of: [param_hash="
VLOG(6) << "Found a cached parametric storage of: [param_hash="
<< hash_value << ", storage_ptr=" << pr.first->second << "].";
return pr.first->second;
}
......@@ -53,7 +53,7 @@ struct ParametricStorageManager {
}
StorageBase *storage = constructor();
parametric_instances_.emplace(hash_value, storage);
VLOG(4) << "No cache found, construct and cache a new parametric storage "
VLOG(6) << "No cache found, construct and cache a new parametric storage "
"of: [param_hash="
<< hash_value << ", storage_ptr=" << storage << "].";
return storage;
......@@ -76,7 +76,7 @@ StorageManager::StorageBase *StorageManager::GetParametricStorageImpl(
std::function<bool(const StorageBase *)> equal_func,
std::function<StorageBase *()> constructor) {
std::lock_guard<ir::SpinLock> guard(parametric_instance_lock_);
VLOG(4) << "Try to get a parametric storage of: [TypeId_hash="
VLOG(6) << "Try to get a parametric storage of: [TypeId_hash="
<< std::hash<ir::TypeId>()(type_id) << ", param_hash=" << hash_value
<< "].";
if (parametric_instance_.find(type_id) == parametric_instance_.end()) {
......@@ -89,7 +89,7 @@ StorageManager::StorageBase *StorageManager::GetParametricStorageImpl(
StorageManager::StorageBase *StorageManager::GetParameterlessStorageImpl(
TypeId type_id) {
std::lock_guard<ir::SpinLock> guard(parameterless_instance_lock_);
VLOG(4) << "Try to get a parameterless storage of: [TypeId_hash="
VLOG(6) << "Try to get a parameterless storage of: [TypeId_hash="
<< std::hash<ir::TypeId>()(type_id) << "].";
if (parameterless_instance_.find(type_id) == parameterless_instance_.end())
IR_THROW("TypeId not found in IrContext.");
......@@ -100,7 +100,7 @@ StorageManager::StorageBase *StorageManager::GetParameterlessStorageImpl(
void StorageManager::RegisterParametricStorageImpl(
TypeId type_id, std::function<void(StorageBase *)> destroy) {
std::lock_guard<ir::SpinLock> guard(parametric_instance_lock_);
VLOG(4) << "Register a parametric storage of: [TypeId_hash="
VLOG(6) << "Register a parametric storage of: [TypeId_hash="
<< std::hash<ir::TypeId>()(type_id) << "].";
parametric_instance_.emplace(
type_id, std::make_unique<ParametricStorageManager>(destroy));
......@@ -109,7 +109,7 @@ void StorageManager::RegisterParametricStorageImpl(
void StorageManager::RegisterParameterlessStorageImpl(
TypeId type_id, std::function<StorageBase *()> constructor) {
std::lock_guard<ir::SpinLock> guard(parameterless_instance_lock_);
VLOG(4) << "Register a parameterless storage of: [TypeId_hash="
VLOG(6) << "Register a parameterless storage of: [TypeId_hash="
<< std::hash<ir::TypeId>()(type_id) << "].";
if (parameterless_instance_.find(type_id) != parameterless_instance_.end())
IR_THROW("storage class already registered");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册