As indicated from the opening line, the primary figure of speech is a metaphoric comparison between the speaker's love interest to a summer day. This is explored throughout the sonnet, such as in lines 2 and 3 ("Thou art more lovely and more temperate:/ Rough winds do shake the darling buds of May.") The comparative language can also be seen in line 9, when the speaker suggests that "But thy eternal summer shall not fade." In this comparison, the love interest of the speaker is directly linked to the natural patterns found in late Spring/ Summer, helping to illuminate both the natural sense of beauty found in the world as well as the individual sense of devotion and love shared between both speaker and love interest.
A figure of speech is a useful tool in literature, and introduces an inferred meaning into a description other than the literal interpretation. This allows for vivid descriptions and visual images which intensify the significance contained in, in this instance, Shakespeare's Sonnet 18 which begins with the familiar words "Shall I compare thee to a Summer's Day?" Shakespeare directs a question at the object of his admiration, and not expecting an answer, he answers himself adding great emphasis to the poem. The question is, therefore, rhetorical. Of course, the answer would be a resounding affirmation and in fact Shakespeare's subject is far "more lovely and more temperate." The opening line is a much repeated line in many romantic encounters, not all of which are sincere expressions of admiration. However, Shakespeare's intention is in no doubt and he uses metaphor to make his comparison with a summer's day.
His talk of "temperate" weather and "rough winds" reveals the enduring characteristics of his subject who is not affected by change, and the metaphor is extended so that the reader cannot mistake Shakespeare's feelings of high regard for someone whose "eternal summer shall not fade." It is significant that Shakespeare talks of the month of May which passes and of summer as the seasons change. "Nature's changing course" confirms that it would not be possible to sustain a "gold complexion" but, for Shakespeare's subject, not even Death (personified) can hold him in "his shade."
1 personification "the eye of heaven shines", this actually means the sun in the sky.
2 metonymy "when in eternal lines to time thou grow'st", here "lines" refers the poem.