Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions enzyme/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,15 @@ option(ENZYME_APPLE_DYNAMIC_LOOKUP
option(ENZYME_STATIC_LIB "Build static library" OFF)
option(ENZYME_WARN_COMPILER "Warn if enzyme detects potentially incompatible compiler" ON)
option(ENZYME_ENABLE_REACTANT "Build support library for Reactant C++ frontend" OFF)
option(
ENZYME_DEFAULT_STRICT_ALIASING
"Default -enzyme-strict-aliasing to true"
ON
)
add_compile_definitions(
ENZYME_DEFAULT_STRICT_ALIASING=$<BOOL:${ENZYME_DEFAULT_STRICT_ALIASING}>
)

set(ENZYME_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(ENZYME_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(Fortran_COMPILER ${CMAKE_Fortran_COMPILER})
Expand Down
8 changes: 6 additions & 2 deletions enzyme/Enzyme/TypeAnalysis/TypeAnalysis.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@

using namespace llvm;

#ifndef ENZYME_DEFAULT_STRICT_ALIASING
#define ENZYME_DEFAULT_STRICT_ALIASING 1
#endif

extern "C" {
/// Maximum offset for type trees to keep
llvm::cl::opt<int> MaxIntOffset("enzyme-max-int-offset", cl::init(100),
Expand All @@ -90,8 +94,8 @@ llvm::cl::opt<bool> RustTypeRules("enzyme-rust-type", cl::init(false),
cl::desc("Enable rust-specific type rules"));

llvm::cl::opt<bool> EnzymeStrictAliasing(
"enzyme-strict-aliasing", cl::init(true), cl::Hidden,
cl::desc("Assume strict aliasing of types / type stability"));
"enzyme-strict-aliasing", cl::init(ENZYME_DEFAULT_STRICT_ALIASING != 0),
cl::Hidden, cl::desc("Assume strict aliasing of types / type stability"));
}

const llvm::StringMap<llvm::Intrinsic::ID> LIBM_FUNCTIONS = {
Expand Down
Loading