As per comments, this question is referring to guided weapons such as Stinger (IR guidance).
Guided missiles that acquire their target via signal return, such as infrared, radar or laser designation (Homing Guidance, see section 16.4.2) have absolutely no need to "know" their orientation in space. A target lock is established pre or post launch and then maintained by missile sensors, and the sensor signal is then used to calculate necessary maneuvers to steer towards the target.
Any information regarding where in space and in what alignment in reference to earth the missile actually is, is useless: only the position with regards to the target is of importance, as reaching the target is a matter of actions within the frame of reference of the missile, not the earth: the target exist in certain three dimensional(* point in space in relation to the missile sensor. The guidance system updates this "situational image" at certain intervals (several times a second) and the difference between images is used to calculate the rate of change and then the necessary steering inputs.
Adding sensors and algorithms relating to spatial situation with regard to earth's frame of reference add unnecessary complexity (and thus extra fail modes) to this kind of weapons. Within the maneuverability envelope of these missiles the "direction" of gravity is not of crucial importance.
*)To be precise, whether 3-, or just 2-dimensional situation image is actually necessary is an interesting question, as the missiles of this sort are not "throttle-able", so they speed on at full power until target is destroyed or fuel is depleted. Actual or relative speed are therefore of no importance. However, some missiles do not need to impact the target to detonate, so they must have some way to determine the sufficient proximity to the target to arm and explode.