AMDGPU: Allow vectorization of round intrinsic
authorMatt Arsenault <Matthew.Arsenault@amd.com>
Fri, 20 Mar 2020 21:16:46 +0000 (17:16 -0400)
committerMatt Arsenault <arsenm2@gmail.com>
Mon, 23 Mar 2020 21:00:41 +0000 (17:00 -0400)
commit66073953a5cb7ecac32bcb897033fdc337c56b5e
tree6a6ec427ebdbd432574f02633c0a0d3b26c1a159
parent5896e2df45dab7680be321ee63903431a673817b
AMDGPU: Allow vectorization of round intrinsic

There seems to be a small benefit to the legalized sequence for v2f16
round with packed instructions, so allow vectorizing it by reducing
the cost.

An unintended side effect is vectorization of f32 round also
happens. The current FMA logic seems off to me, and isn't checking for
packed instructions.
llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp
llvm/test/Transforms/SLPVectorizer/AMDGPU/round.ll [new file with mode: 0644]