Check for Instruction if movable or not

Is there any function to check if one instruction is safe to be moved at a given position or not? I guess it is not there yet. So is it possible to create a function that can return a boolean provided the position is a parameter? I think this function can be made using the concept of dominator and UD chain.