summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-isel-fuzzer
Commit message (Collapse)AuthorAgeFilesLines
* Move some CLI utils out of llvm-isel-fuzzer and into the libraryJustin Bogner2017-09-022-51/+5
| | | | | | | | FuzzMutate might not be the best place for these, but it makes more sense than an entirely new library for now. This will make setting up fuzz targets with consistent CLI handling easier. llvm-svn: 312425
* llvm-isel-fuzzer: Weak function invoke the ire of PE/COFFJustin Bogner2017-09-011-4/+1
| | | | | | | | | | | | | | | It's non-trivial to use weak symbols in a cross platform way (See sanitizer_win_defs.h in compiler-rt), and doing it naively like we have here causes some build failures: http://lab.llvm.org:8011/builders/clang-with-thin-lto-windows/builds/1260 Instead of going down the rabbit hole of emulating weak symbols for this very trivial dummy fuzzer driver, we can just rely on the fact that we know which hooks any given fuzz target implements and forward declare a normal symbol. llvm-svn: 312354
* llvm-isel-fuzzer: Add link-time dependency on BitWriterJustin Bogner2017-09-011-0/+1
| | | | | | | | | | This should fix the undefined reference to WriteBitcodeToFile here: http://bb.pgr.jp/builders/i686-mingw32-RA-on-linux/builds/31682 (Why does every different bot seem to have a different level of finickiness about LLVM_LINK_COMPONENTS?) llvm-svn: 312345
* llvm-isel-fuzzer: Add link-time dependency on BitReaderJustin Bogner2017-09-011-0/+1
| | | | | | | This should fix the undefined reference to parseBitcodeFile here: http://bb.pgr.jp/builders/llvm-i686-linux-RA/builds/5785 llvm-svn: 312343
* Specify the namespace in llvm::make_unique to fix the windows buildJustin Bogner2017-09-011-1/+1
| | | | llvm-svn: 312341
* llvm-isel-fuzzer: Make buildable and testable without libFuzzerJustin Bogner2017-09-012-1/+58
| | | | | | | | | | | | | | This adds a dummy main so we can build and run the llvm-isel-fuzzer functionality when we aren't building LLVM with coverage. The approach here should serve as a template to stop in-tree fuzzers from bitrotting (See llvm.org/pr34314). Note that I'll probably move most of the logic in DummyISelFuzzer's `main` to a library so it's easy to reuse it in other fuzz targets, but I'm planning on doing that in a follow up that also consolidates argument handling in our LLVMFuzzerInitialize implementations. llvm-svn: 312338
* cmake: Invent add_llvm_fuzzer to set up fuzzer targetsJustin Bogner2017-08-311-20/+15
| | | | | | | | | | | | | | | | This moves the cmake configuration for fuzzers in LLVM to a new macro, add_llvm_fuzzer. This will make it easier to keep things consistent while implementing llvm.org/pr34314. I've also made a couple of minor functional changes here: - the fuzzers now use add_llvm_executable rather than add_llvm_tool. This means they won't create install targets and stuff like that, because those made little sense for these fuzzers. - I've grouped these under "Fuzzers" rather than in with "Tools" for people who build with IDEs. llvm-svn: 312200
* llvm-isel-fuzzer: Stop including FuzzerInterface.hJustin Bogner2017-08-312-3/+0
| | | | | | | | | All this does is forward declare the interface functions (and make sure that they're `extern "C"`), but since we're using libFuzzer from the toolchain it doesn't make sense to include the local copy of the interface. llvm-svn: 312195
* Implement llvm-isel-fuzzer for fuzzing instruction selectionJustin Bogner2017-08-292-0/+235
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
OpenPOWER on IntegriCloud