On Windows, offload-arch fails to find or loads the wrong amdhip64 DLL
when running from a source-built LLVM/Clang installation where the
executable and HIP runtime are in different subdirectories.
Three fixes:
1. getSearchPaths(): walk parent directories appending /bin to each, so
layouts like <root>/lib/llvm/bin/offload-arch can discover
<root>/bin/amdhip64_*.dll. Capped at 6 levels with root detection.
Case-insensitive dedup for Windows paths.
2. findNewestHIPDLL(): use stable_sort to preserve search-path order on
version ties, so a colocated build DLL wins over a system copy.
3. printGPUsByHIP(): prime the DLL load with LoadLibraryExW and
LOAD_WITH_ALTERED_SEARCH_PATH so transitive dependencies resolve from
the DLL own directory. Uses LLVM convertUTF8ToUTF16String for path
conversion.
Also fixes two pre-existing bugs: inverted current_path error check
(line 138) and missing break in HipApiVersion switch (line 421).
---------
Co-authored-by: Samiii777 <Samiii777@users.noreply.github.com>