[IR] Add Instruction::maySynchronize() method (NFC) (#196052)
Extract the logic from FunctionAttrs into a generic API on Instruction,
which will check the nosync flag on calls and ordering for atomic
instructions.
For now, I've retained the previous implementation which considers
monotonic ordering to be synchronizing, which is unnecessarily
conservative and doesn't match LangRef (or the Attributor
implementation).
This is to make it easier to reuse this logic in more places.