[LSR] Cleanup of getPreferredAddresingMode. NFC.

This is a follow up D96600 and cleans up most calls to
getPreferredAddresingMode. I.e., we really don't need to query the same things
again and again, but get the preferred addressing mode once for each loop. So
this should be a lot friendlier for compile times, especially if we start
implementing getPreferredAddresingMode.

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

GitOrigin-RevId: dea4a63e635924ef6c00556d8f30d94e36864274
1 file changed