[polly] Add nullptr check to fix #113772 (#114206)

The patch adds a nullptr check before accessing the loop blocks in
'hasPossiblyDistributableLoop' function. The existing check for the
loop’s containment in the region does not capture nullptr cases when the
region covers the entire function. Therefore, it’s better to exit if the
basic block isn’t part of any loop

Fixes #113772.

GitOrigin-RevId: 4cb71701994e129c1beca77134b39137ea8752c3
2 files changed