Prefetch Optimization Tool
This page documents the software prefetching frontend backed by
lib/Optimization/Prefetch/.
Implementation Location: lib/Optimization/Prefetch/
Tool
Binary:
lotus-opt-prefetchSource:
tools/optimization/lotus-opt-prefetch.cppPass:
SWPrefetchingLLVMPass
Example:
build/bin/lotus-opt-prefetch input.bc \
--prefetch-distance-provider=profile \
--profile=perf.prof \
-o prefetched.bc
build/bin/lotus-opt-prefetch input.bc \
--prefetch-distance-provider=lbr \
--dist=32 \
-o prefetched-lbr.bc
Configuration
--profile=<file>supplies the sample-profile input used by the profile provider.--prefetch-distance-provider=profileuses sample-profile hints.--prefetch-distance-provider=lbruses explicit LBR distances from--dist.--prefetch-distance-provider=llmuses explicit distances from--llm-dist.--prefetch-distance-provider=staticreserves the static-analysis mode.--input-fileremains accepted as the underlying legacy pass option, but--profileis the preferred frontend spelling.
Notes
The pass is registered from
lib/Optimization/Prefetch/SWPrefetchingPass.cpp.The implementation uses loop analysis and inserts LLVM prefetch intrinsics for supported access patterns.