From 69f7eb8718c8257777418bf177f2a7c23b102282 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 16 Aug 2022 20:05:12 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- taichi/codegen/llvm/codegen_llvm.cpp | 3 ++- taichi/ir/type_utils.h | 13 +++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/taichi/codegen/llvm/codegen_llvm.cpp b/taichi/codegen/llvm/codegen_llvm.cpp index ea4a3c18368cbb..1f114fdb968bcf 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 39a5236af4bd25..f2b6ad82c25801 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;