[AMDGPU] Refactor PromoteAlloca implementation
We're getting a lot of mileage out of PromoteAlloca, and the pass had grown somewhat organically over the year.
This patch attempts to clean up the implementation and restructure it. For instance,
the exact same code path is now used for both promote alloca to LDS and
promote alloca to vector - just with different parameters.
This removes some redundancy here and there.
I also reordered functions in a way that hopefully makes more sense (e.g. all of the pass API is in the same place)
No functionality change is intended in the patch, but some checks were movved around so I'm not using the NFC tag.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D148526