[test-suite] r283401 - Document the process of generating bitcode tests/benchmarks from Halide.

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 5 15:20:10 PDT 2016


Author: asbirlea
Date: Wed Oct  5 17:20:10 2016
New Revision: 283401

URL: http://llvm.org/viewvc/llvm-project?rev=283401&view=rev
Log:
Document the process of generating bitcode tests/benchmarks from Halide.

Modified:
    test-suite/trunk/Bitcode/README_HalideCodegen

Modified: test-suite/trunk/Bitcode/README_HalideCodegen
URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/Bitcode/README_HalideCodegen?rev=283401&r1=283400&r2=283401&view=diff
==============================================================================
--- test-suite/trunk/Bitcode/README_HalideCodegen (original)
+++ test-suite/trunk/Bitcode/README_HalideCodegen Wed Oct  5 17:20:10 2016
@@ -1,7 +1,6 @@
 Intro to Halide codegeneration pattern (based on Halide documentation)
 ===========================================================================
 
-
 functionName:
 ============
 Functions generated by Halide are regular functions with a user chosen name and arguments.
@@ -22,7 +21,43 @@ The wrapper calls the function with an a
 This is easier for the JIT to call than a function with an unknown
 (at compile time) argument list.
 
+E.g. The unit tests "simd_ops" contain functions called "test_op" and "scalar_test_op"
+
+
+HOW TO: Halide bitcode generation and creating of tests and benchmarks
+=======================================================================
+
+The Halide tests in test-suite/Bitcode were generated using Halide ToT at:
+https://github.com/halide/Halide
+
+Creating a test or an application from bitcode generated code requires these stages:
+1. Define a Halide pipeline
+2. Generate a bitcode file with the Halide pipeline as a method, along with a header for the method prototype.
+3. Create a C driver that calls the method generated, times it, compares against reference etc.
+4. Link the C driver, bitcode file and Halide runtime (an already generated bitcode file found in test-suite/Bitcode)
+into an executable.
+
+1. To create a Halide pipeline/application, please visit the Halide tutorial:
+http://halide-lang.org/tutorials/tutorial_introduction.html
+The tests and benchmarks in test-suite/Bitcode were generated from:
+https://github.com/halide/Halide/blob/master/test/correctness/simd_op_check.cpp
+and
+https://github.com/halide/Halide/tree/master/apps
+
+2. Each Halide function (Func) and pipeline (Pipeline) have the following methods:
+compile_to_file: generates a header and object files
+compile_to_header: generates just a header file
+compile_to_object: generates just an object file
+compile_to_bitcode: generates a bitcode file
+compile_to_llvm_assembly: generates a disassembled bitcode file (.ll)
+These method provide the interface to chose a function name and file name for the Func/Pipeline.
+An example from the Halide correctness tests:
+https://github.com/halide/Halide/blob/master/test/correctness/simd_op_check.cpp#L166
+
+3. The methods in the bitcode files generated for the test at 2. are invoked by the following driver:
+https://github.com/halide/Halide/blob/master/apps/simd_op_check/driver.cpp
 
-E.g. The unit tests "simd_ops" contain functions called "unopt_test_op" and "unopt_scalar_test_op"
+4. Typical build command for a Halide application:
+clang++ test.bc driver.cpp halide_runtime.bc -lpthread -ldl
 
 




More information about the llvm-commits mailing list