Skip to content

Commit

Permalink
A few more tidy fixes, cleanup, internal doc fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bluescarni committed Oct 5, 2023
1 parent 9642a10 commit 5e4837b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ SpacesInContainerLiterals: false
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
Standard: Auto
TabWidth: 4
UseTab: Never
2 changes: 1 addition & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
Checks: 'clang-diagnostic-*,clang-analyzer-*,*,-hicpp-uppercase-literal-suffix,-readability-uppercase-literal-suffix,-modernize-use-trailing-return-type,-readability-named-parameter,-hicpp-named-parameter,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay,-llvm-header-guard,-cppcoreguidelines-macro-usage,-google-runtime-references,-readability-isolate-declaration,-fuchsia-default-arguments-calls,-fuchsia-overloaded-operator,-fuchsia-default-arguments-declarations,-readability-else-after-return,-google-runtime-int,-hicpp-signed-bitwise,-cert-dcl21-cpp,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-avoid-c-arrays,-hicpp-avoid-c-arrays,-modernize-avoid-c-arrays,-modernize-use-transparent-functors,-cert-dcl16-c,-cppcoreguidelines-pro-type-union-access,-bugprone-branch-clone,-fuchsia-statically-constructed-objects,-cppcoreguidelines-pro-bounds-constant-array-index,-readability-static-accessed-through-instance,-cppcoreguidelines-pro-type-vararg,-hicpp-vararg,-llvmlibc-restrict-system-libc-headers,-llvmlibc-callee-namespace,-llvmlibc-implementation-in-namespace,-llvm-else-after-return,-fuchsia-trailing-return,-readability-identifier-length,-altera-unroll-loops,-altera-id-dependent-backward-branch,-altera-struct-pack-align,-performance-no-int-to-ptr,-readability-function-cognitive-complexity'
Checks: 'clang-diagnostic-*,clang-analyzer-*,*,-hicpp-uppercase-literal-suffix,-readability-uppercase-literal-suffix,-modernize-use-trailing-return-type,-readability-named-parameter,-hicpp-named-parameter,-cppcoreguidelines-pro-bounds-array-to-pointer-decay,-hicpp-no-array-decay,-llvm-header-guard,-cppcoreguidelines-macro-usage,-google-runtime-references,-readability-isolate-declaration,-fuchsia-default-arguments-calls,-fuchsia-overloaded-operator,-fuchsia-default-arguments-declarations,-readability-else-after-return,-google-runtime-int,-hicpp-signed-bitwise,-cert-dcl21-cpp,-cppcoreguidelines-avoid-magic-numbers,-readability-magic-numbers,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-type-reinterpret-cast,-cppcoreguidelines-avoid-c-arrays,-hicpp-avoid-c-arrays,-modernize-avoid-c-arrays,-modernize-use-transparent-functors,-cert-dcl16-c,-cppcoreguidelines-pro-type-union-access,-bugprone-branch-clone,-fuchsia-statically-constructed-objects,-cppcoreguidelines-pro-bounds-constant-array-index,-readability-static-accessed-through-instance,-cppcoreguidelines-pro-type-vararg,-hicpp-vararg,-llvmlibc-restrict-system-libc-headers,-llvmlibc-callee-namespace,-llvmlibc-implementation-in-namespace,-llvm-else-after-return,-fuchsia-trailing-return,-readability-identifier-length,-altera-unroll-loops,-altera-id-dependent-backward-branch,-altera-struct-pack-align,-performance-no-int-to-ptr,-readability-function-cognitive-complexity,-misc-include-cleaner,-llvmlibc-inline-function-decl'
WarningsAsErrors: '*'
AnalyzeTemporaryDtors: false
FormatStyle: none
Expand Down
8 changes: 3 additions & 5 deletions include/heyoka/expression.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
#include <optional>
#include <ostream>
#include <sstream>
#include <stdexcept>
#include <string>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <variant>
#include <vector>
Expand Down Expand Up @@ -79,7 +77,7 @@ class HEYOKA_DLL_PUBLIC expression
template <typename Archive>
void serialize(Archive &ar, unsigned)
{
ar &m_value;
ar & m_value;
}

public:
Expand Down Expand Up @@ -138,9 +136,9 @@ HEYOKA_DLL_PUBLIC expression operator""_ldbl(unsigned long long);
#if defined(HEYOKA_HAVE_REAL128)

template <char... Chars>
inline expression operator"" _f128()
inline expression operator""_f128()
{
return expression{mppp::literals::operator"" _rq<Chars...>()};
return expression{mppp::literals::operator""_rq < Chars... > ()};
}

#endif
Expand Down
10 changes: 5 additions & 5 deletions src/llvm_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ auto llvm_state_bc_to_module(const std::string &module_name, const std::string &

} // namespace detail

// NOLINTNEXTLINE(cppcoreguidelines-rvalue-reference-param-not-moved)
llvm_state::llvm_state(std::tuple<std::string, unsigned, bool, bool, bool> &&tup)
: m_jitter(std::make_unique<jit>()), m_opt_level(std::get<1>(tup)), m_fast_math(std::get<2>(tup)),
m_force_avx512(std::get<3>(tup)), m_slp_vectorize(std::get<4>(tup)), m_module_name(std::move(std::get<0>(tup)))
Expand Down Expand Up @@ -1079,11 +1080,10 @@ void llvm_state::optimise()
// NOTE: the reason for this inconsistency is that opt uses PB.parsePassPipeline()
// (instead of PB.buildPerModuleDefaultPipeline()) to set up the optimisation
// pipeline. Indeed, if we replace PB.buildPerModuleDefaultPipeline(ol) with
// PB.buildPerModuleDefaultPipeline(MPM, "default<O3>") (which
// corresponds to invoking "opt -passes='default<O3>'"), we do NOT need to set
// SLP vectorization on here to get the SLP vectorizer. Not sure if we should consider
// switching to this alternative way of setting up the optimisation pipeline
// in the future.
// PB.parsePassPipeline(MPM, "default<O3>") (which corresponds to invoking
// "opt -passes='default<O3>'"), we do NOT need to set SLP vectorization on
// here to get the SLP vectorizer. Not sure if we should consider switching to this
// alternative way of setting up the optimisation pipeline in the future.
llvm::PipelineTuningOptions pto;
pto.SLPVectorization = m_slp_vectorize;
llvm::PassBuilder PB(m_jitter->m_tm.get(), pto);
Expand Down
1 change: 1 addition & 0 deletions src/taylor_02.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -975,6 +975,7 @@ std::pair<llvm::Value *, llvm::Type *> taylor_compute_jet_compact_mode(
//
// to pass the data necessary to the parallel workers.
par_data_t = llvm::StructType::get(context, {builder.getInt32Ty(), ext_fp_ptr_t, ext_fp_ptr_t});
// NOLINTNEXTLINE(cppcoreguidelines-owning-memory)
gl_par_data = new llvm::GlobalVariable(md, par_data_t, false, llvm::GlobalVariable::InternalLinkage,
llvm::ConstantAggregateZero::get(par_data_t));

Expand Down

0 comments on commit 5e4837b

Please sign in to comment.