Gilberto Gil throws himself into music entirely. When he played at Irving Plaza on Tuesday night, to see him yelping percussive shouts through the rhythm of his band, or picking a fast pattern on the guitar, was to believe that there is no artistic distance between him and it.

But the lyrics of Mr. Gil, the great Brazilian pop songwriter, are more than heated transmissions of energy. They peer at the world analytically, subtly criticizing governments or praising tolerance; they establish philosophies of history, and they create a web of musical references that teach listeners about the genealogy of Brazilian popular art.

Through the set he introduced songs like a musicologist; when his lead guitarist strapped on a mandolin, Mr. Gil noted that the instrument represented the Mediterranean strain in Brazilian music, from Portugal and Spain. It makes sense that Mr. Gil has been attracted to reggae, which since the 1970's has been a pan-global force for black musicians and has had a huge impact on Brazilian music. But Mr. Gil also found in reggae, especially in Bob Marley's songs, a good medium for combining social criticism and religion in popular music.

He has experimented with reggae a lot since the late 1970's, and it is now the dominant style in his live performances; it took up more than half of the Irving Plaza show, including a version of Marley's ''Stir It Up'' and a convincing reggae version of George Harrison's ''Something.'' But whereas reggae's dominant literary mode is sufferance, Mr. Gil is irrepressibly positive; he is interested in solutions. Brazil's poverty was addressed in ''Opachoro'' by means of a prayer to the Yoruban deity Oxala for betterment; the song was all about keeping faith rather than enumerating ills.

He is also interested in cycles and new beginnings; in his old song ''Refavela'' he suggested a kind of reawakening for Brazil's poor disfranchised blacks by a reattachment to Afro-Brazilian culture. And the circular musical structure of ''Flora,'' a tender song written for his wife, implied a love that keeps reinventing itself.

Mr. Gil also played several more rhythmically intense songs built around the baiao rhythm from Brazil's northeast, by the composers Gordurinha and Luiz Gonzaga; at one point two members of his seven-piece band appeared to play Bahian drum patterns. Mr. Gil often performed vocal improvisations, falsetto chants, designed to engage the crowd. His band is a pop band, with saxophone, keyboards and electric guitar; it is built for the road, and it put in a cheery and workmanlike set, totally submerged in the idea of popular music as a casual affair. But there are few performers anywhere who match his agility and optimism while singing serious thoughts.

Photo: Irrepressibly positive: Gilberto Gil performing at Irving Plaza. (Jack Vartoogian)