Runtime unrolling of loops needs to emit an expression to compute the
loop's runtime trip-count. Avoid runtime unrolling if this computation
will be expensive.
Depends on D8993.
Paths
| Differential D8994
[LoopUnrollRuntime] Avoid high-cost trip count computation. ClosedPublic Authored by sanjoy on Apr 12 2015, 12:00 AM.
Details Summary Runtime unrolling of loops needs to emit an expression to compute the Depends on D8993.
Diff Detail Event Timelinesanjoy updated this object. Comment Actions You'll need to add a field in the UnrollingPreferences structure to control this. The makes a lot of sense on X86, where we only unroll small loops to fill the LSD's dispatch buffer (and they're still pretty small even after unrolling). On other targets we unroll to much larger sizes and the cost of a division is amortized over many more instructions and iterations. This revision now requires changes to proceed.Apr 12 2015, 5:24 AM sanjoy edited edge metadata. Comment ActionsI've added AllowExpensiveTripCount to UnrollPreferences. I don't
Closed by commit rL234846: [LoopUnrollRuntime] Avoid high-cost trip count computation. (authored by sanjoy). · Explain WhyApr 13 2015, 8:23 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 23659 include/llvm/Analysis/TargetTransformInfo.h
include/llvm/Transforms/Utils/UnrollLoop.h
lib/Transforms/Scalar/LoopUnrollPass.cpp
lib/Transforms/Utils/LoopUnroll.cpp
lib/Transforms/Utils/LoopUnrollRuntime.cpp
test/Transforms/LoopUnroll/high-cost-trip-count-computation.ll
test/Transforms/LoopUnroll/runtime-loop.ll
test/Transforms/LoopUnroll/runtime-loop4.ll
|