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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ vcpkg_installed/
################################################################################
## IDE directories and metadata

.ccls-cache/

# Visual Studio
.vs/
out/
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ SOURCE_FILES = \
EmulateFloat16Math.cpp \
Error.cpp \
Expr.cpp \
ExprInterpreter.cpp \
ExtractTileOperations.cpp \
FastIntegerDivide.cpp \
FindCalls.cpp \
Expand Down Expand Up @@ -703,6 +704,7 @@ HEADER_FILES = \
EmulateFloat16Math.h \
Error.h \
Expr.h \
ExprInterpreter.h \
ExprUsesVar.h \
Extern.h \
ExternFuncArgument.h \
Expand Down
24 changes: 24 additions & 0 deletions src/IR.h
Original file line number Diff line number Diff line change
Expand Up @@ -883,6 +883,30 @@ struct Call : public ExprNode<Call> {
Call::strict_sub});
}

/** Does not include the strict_float intrinsics. */
bool is_arithmetic_intrinsic() const {
return is_intrinsic(
{Call::widen_right_add,
Call::widen_right_mul,
Call::widen_right_sub,
Call::widening_add,
Call::widening_mul,
Call::widening_sub,
Call::saturating_add,
Call::saturating_sub,
Call::saturating_cast,
Call::widening_shift_left,
Call::widening_shift_right,
Call::rounding_shift_right,
Call::rounding_shift_left,
Call::halving_add,
Call::halving_sub,
Call::rounding_halving_add,
Call::rounding_mul_shift_right,
Call::mul_shift_right,
Call::sorted_avg});
}

static const IRNodeType _node_type = IRNodeType::Call;
};

Expand Down
5 changes: 3 additions & 2 deletions test/fuzz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,15 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, std::size_t Size) {
}
]] HAVE_LIBFUZZER_FLAGS)

add_library(Halide_fuzz INTERFACE)
add_library(Halide_fuzz OBJECT)
add_library(Halide::fuzz ALIAS Halide_fuzz)
target_sources(Halide_fuzz PRIVATE ExprInterpreter.cpp)

if (NOT HAVE_LIBFUZZER_FLAGS)
if (LIB_FUZZING_ENGINE)
message(FATAL_ERROR "Cannot set LIB_FUZZING_ENGINE when not building with -fsanitize=fuzzer or a compatible fuzzing engine.")
endif ()
target_sources(Halide_fuzz INTERFACE halide_fuzz_main.cpp halide_fuzz_main.h)
target_sources(Halide_fuzz PRIVATE halide_fuzz_main.cpp halide_fuzz_main.h)
target_compile_definitions(Halide_fuzz INTERFACE HALIDE_FUZZER_BACKEND=HALIDE_FUZZER_BACKEND_STDLIB)
else ()
target_link_libraries(Halide_fuzz INTERFACE ${LIB_FUZZING_ENGINE})
Expand Down
Loading
Loading