[DirectX] Prevent `dxil-resource-access` from entering an infinite phi loop (#211345)
The pass will enter an infinite loop when collecting the handles if the
phi nodes loop: https://godbolt.org/z/77sr89oMj.
The pass will enter an infinite loop when trying to resolve the handle
index of a dynamic resource if the phi nodes loop:
https://godbolt.org/z/h4oW7Me5G.
This is resolved by updating `collectUsedHandles`/`getAccessIndices`
with a visited set of phi nodes.
Resolves, in part, https://github.com/llvm/llvm-project/issues/211121
Assisted by: Claude Opus 4.8