The NEC (NFPA 70) does not specify requirements regarding this. However, the National Fire Alarm code (NFPA 72) does. Here is an excerpt from NFPA 72:
"AC primary (main) power shall be supplied either from a dedicated branch circuit or the unswitched portion of a branch circuit also used for power and lighting. When installing single- or multiple-station smoke alarms, it is good practice to connect the power to a branch circuit serving lighting outlets in a habitable area, such as a hallway, living room, or family room. This is done to ensure that if for any reason the circuit breaker is tripped or in the ‘‘off’’ position, the condition will be noticed more quickly because lights and other loads used frequently in the dwelling unit will not operate. The power connection to a household fire alarm control panel can be connected in the same way. When connecting to a branch circuit that serves lighting and other loads, the installer must ensure that the
circuit is not overloaded, causing the circuit breaker to frequently trip. Some state and local codes may require this power connection to be made to a dedicated branch circuit. Consult with the authority having jurisdiction to determine if local codes or regulations differ from Code requirements in this section. For standard (as compared with those addressed in subsection 11.6.7) single- and multiplestation alarms, the power must not be connected to the switched portion of a branch circuit. Connection to a switched portion of a circuit will likely lead to the alarms being disabled without the occupant’s knowledge."