[openmp] Add addrspacecast to getOrCreateIdent

Fixes 51982. Minor refactor to remove `return x = y` construct.

Test case derived from https://github.com/ROCm-Developer-Tools/aomp/\
blob/aomp-dev/test/smoke/nest_call_par2/nest_call_par2.c by deleting
parts while checking the assertion failure still occurred.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D110556

GitOrigin-RevId: 1a761e5b7b50dc08e0ff7f7aea65e1da29c5cd80
1 file changed