1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00
Justin Bogner 5496868ee8 Implement llvm-isel-fuzzer for fuzzing instruction selection
This implements a fuzzer tool for instruction selection, as described
in my [EuroLLVM 2017 talk][1].

The fuzzer must be given both libFuzzer args and llc-like args to
configure the backend. For example, to fuzz AArch64 GlobalISel at -O0,
you could invoke like so:

  llvm-isel-fuzzer <corpus dirs> -ignore_remaining_args=1 \
                   -mtriple arm64-apple-ios -global-isel -O0

If you would like to seed the fuzzer with an initial corpus, simply
provide a directory of valid LLVM bitcode (not textual IR) as one of
the corpus dirs.

[1]: http://llvm.org/devmtg/2017-03//2017/02/20/accepted-sessions.html#2

llvm-svn: 311964
2017-08-29 00:22:08 +00:00

23 lines
477 B
CMake

if( LLVM_USE_SANITIZE_COVERAGE )
include_directories(BEFORE
${CMAKE_CURRENT_SOURCE_DIR}/../../lib/Fuzzer)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=fuzzer")
set(LLVM_LINK_COMPONENTS
${LLVM_TARGETS_TO_BUILD}
Analysis
AsmPrinter
CodeGen
Core
FuzzMutate
IRReader
MC
ScalarOpts
SelectionDAG
Support
Target
)
add_llvm_tool(llvm-isel-fuzzer
llvm-isel-fuzzer.cpp)
endif()