This is useful when we face certain intrinsics such as llvm.exp.*
which cannot be lowered by the NVPTX backend while other intrinsics can.
So, we would need to keep blacklists of intrinsics that cannot be
handled by the NVPTX backend. It is much simpler to try and promote
all intrinsics to libdevice versions.
This patch makes function/intrinsic very uniform, and will always try to use
a libdevice version if it exists.
Instead of trying to parse the name of the intrinsic, could you just map from an exact llvm intrinsic name to the equivalent libdevice function? e.g. map llvm.powi.f32 to __nv_powif, llvm.powi.f64 to __nv_powi, etc.