The correct option is (D): Metaphor.
The figure of speech used in the expression "All the world is a stage" is a Metaphor. A metaphor is a figure of speech that makes a comparison between two things by stating that one thing is another thing. In this case, the metaphor suggests that the world is like a stage, implying that life and human interactions resemble a theatrical performance.