Revision f2d750f355fccadcd03af51bcb58af724719859c authored by Roman Lebedev on 14 February 2024, 20:35:52 UTC, committed by GitHub on 14 February 2024, 20:35:52 UTC
```
[2336/4154] /usr/bin/clang++-17 -DHALIDE_ENABLE_RTTI -DHALIDE_VERSION_MAJOR=17 -DHALIDE_VERSION_MINOR=0 -DHALIDE_VERSION_PATCH=0 -DHALIDE_WITH_EXCEPTIONS -I/build/halide-17.0.0/test/common -I/build/halide-17.0.0/tools -I/build/halide-17.0.0/build/stage-1/halide/include -g -fdebug-default-version=4 -fprofile-use=/build/halide-17.0.0/build-profile/default.profdata -fcs-profile-generate -Xclang -mllvm -Xclang -vp-counters-per-site=100.0 -fuse-ld=lld-17 -Wl,--build-id=sha1 -std=c++17 -flto=thin -fPIE -fvisibility=hidden -fvisibility-inlines-hidden -Winvalid-pch -Xclang -include-pch -Xclang /build/halide-17.0.0/build/stage-1/halide/test/CMakeFiles/_test_internal.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /build/halide-17.0.0/build/stage-1/halide/test/CMakeFiles/_test_internal.dir/cmake_pch.hxx -MD -MT test/correctness/CMakeFiles/correctness_float16_t.dir/float16_t.cpp.o -MF test/correctness/CMakeFiles/correctness_float16_t.dir/float16_t.cpp.o.d -o test/correctness/CMakeFiles/correctness_float16_t.dir/float16_t.cpp.o -c /build/halide-17.0.0/test/correctness/float16_t.cpp
<...>
ld.lld-17: error: undefined hidden symbol: __extendhfsf2
>>> referenced by float16_t.cpp:391 (/build/halide-17.0.0/test/correctness/float16_t.cpp:391)
>>>               lto.tmp:(main)
>>> did you mean: __extendbfsf2
>>> defined in: /lib/x86_64-linux-gnu/libgcc_s.so.1
clang++-17: error: linker command failed with exit code 1 (use -v to see invocation)

```
1 parent 40a622f
Raw File
Prefetch.h
#ifndef HALIDE_PREFETCH_H
#define HALIDE_PREFETCH_H

/** \file
 * Defines the lowering pass that injects prefetch calls when prefetching
 * appears in the schedule.
 */

#include <map>
#include <string>
#include <vector>

namespace Halide {

struct Target;

namespace Internal {

class Function;
struct PrefetchDirective;
struct Stmt;

/** Inject placeholder prefetches to 's'. This placholder prefetch
 * does not have explicit region to be prefetched yet. It will be computed
 * during call to \ref inject_prefetch. */
Stmt inject_placeholder_prefetch(const Stmt &s, const std::map<std::string, Function> &env,
                                 const std::string &prefix,
                                 const std::vector<PrefetchDirective> &prefetches);
/** Compute the actual region to be prefetched and place it to the
 * placholder prefetch. Wrap the prefetch call with condition when
 * applicable. */
Stmt inject_prefetch(const Stmt &s, const std::map<std::string, Function> &env);

/** Reduce a multi-dimensional prefetch into a prefetch of lower dimension
 * (max dimension of the prefetch is specified by target architecture).
 * This keeps the 'max_dim' innermost dimensions and adds loops for the rest
 * of the dimensions. If maximum prefetched-byte-size is specified (depending
 * on the architecture), this also adds an outer loops that tile the prefetches. */
Stmt reduce_prefetch_dimension(Stmt stmt, const Target &t);

/** Hoist all the prefetches in a Block to the beginning of the Block.
 * This generally only happens when a loop with prefetches is unrolled;
 * in some cases, LLVM's code generation can be suboptimal (unnecessary register spills)
 * when prefetches are scattered through the loop. Hoisting to the top of the
 * loop is a good way to mitigate this, at the cost of the prefetch calls possibly
 * being less useful due to distance from use point. (This is a bit experimental
 * and may need revisiting.) See also https://bugs.llvm.org/show_bug.cgi?id=51172 */
Stmt hoist_prefetches(const Stmt &s);

}  // namespace Internal
}  // namespace Halide

#endif
back to top