diff --git a/taichi/codegen/llvm/codegen_llvm.cpp b/taichi/codegen/llvm/codegen_llvm.cpp index d329d1eb6f93d..d76a0252ce6fe 100644 --- a/taichi/codegen/llvm/codegen_llvm.cpp +++ b/taichi/codegen/llvm/codegen_llvm.cpp @@ -513,7 +513,8 @@ void TaskCodeGenLLVM::visit(BinaryOpStmt *stmt) { llvm_val[stmt] = builder->CreateShl(llvm_val[stmt->lhs], llvm_val[stmt->rhs]); } else if (op == BinaryOpType::bit_sar) { - if (is_signed(stmt->lhs->element_type()) || is_signed_tensor(stmt->lhs->ret_type)) { + if (is_signed(stmt->lhs->element_type()) || + is_signed_tensor(stmt->lhs->ret_type)) { llvm_val[stmt] = builder->CreateAShr(llvm_val[stmt->lhs], llvm_val[stmt->rhs]); } else { diff --git a/taichi/ir/type_utils.h b/taichi/ir/type_utils.h index 39a5236af4bd2..f2b6ad82c2580 100644 --- a/taichi/ir/type_utils.h +++ b/taichi/ir/type_utils.h @@ -12,12 +12,13 @@ TI_DLL_EXPORT int data_type_size(DataType t); TI_DLL_EXPORT std::string data_type_format(DataType dt); -#define DEFINE_TENSOR_CHECK(func_name) inline bool func_name##_tensor(DataType dt) { \ - if (auto tensor_type = dt->cast()) { \ - return func_name(tensor_type->get_element_type()); \ - } \ - return false; \ -} +#define DEFINE_TENSOR_CHECK(func_name) \ + inline bool func_name##_tensor(DataType dt) { \ + if (auto tensor_type = dt->cast()) { \ + return func_name(tensor_type->get_element_type()); \ + } \ + return false; \ + } inline int data_type_bits(DataType t) { return data_type_size(t) * 8; diff --git a/taichi/transforms/type_check.cpp b/taichi/transforms/type_check.cpp index cf837496ed701..0d81a47d6d685 100644 --- a/taichi/transforms/type_check.cpp +++ b/taichi/transforms/type_check.cpp @@ -220,7 +220,8 @@ class TypeCheck : public IRVisitor { DataType cast_dtype; if (is_tensor) { auto tensor_type = stmt->operand->ret_type->cast(); - cast_dtype = TypeFactory::create_tensor_type(tensor_type->get_shape(), config_.default_fp); + cast_dtype = TypeFactory::create_tensor_type(tensor_type->get_shape(), + config_.default_fp); } else { cast_dtype = config_.default_fp; }