[AMDGPU] Add amdgpu specific loop threshold metadata
authorTim Corringham <tcorring@amd.com>
Tue, 28 Jul 2020 18:01:03 +0000 (19:01 +0100)
committerTim Corringham <tcorring@amd.com>
Thu, 22 Oct 2020 16:21:32 +0000 (17:21 +0100)
commit3c1273d7378e1d51abf9b43c764ccb9828e4a26a
tree26f73432c8ef1c98dccb45172a9afa996fe749e1
parentaf3c51e3546eccff714ec146fb8daf18177e2028
[AMDGPU] Add amdgpu specific loop threshold metadata

Add new loop metadata amdgpu.loop.unroll.threshold to allow the initial AMDGPU
specific unroll threshold value to be specified on a loop by loop basis.

The intention is to be able to to allow more nuanced hints, e.g. specifying a
low threshold value to indicate that a loop may be unrolled if cheap enough
rather than using the all or nothing llvm.loop.unroll.disable metadata.

Differential Revision: https://reviews.llvm.org/D84779
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
llvm/test/Transforms/LoopUnroll/AMDGPU/unroll-threshold.ll [new file with mode: 0644]