r600: Use llvm intrinsic to read work dimension information

v2: Fix function declaration
    Add range metadata to r600 implementation
v3: change prefix to AMDGPU

Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>

git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@219793 91177308-0d34-0410-b5e6-96231b3b80d8