Defensive players dominated the discussion surrounding the 49ers and their No. 9 pick leading up to the NFL draft, although the possibility of adding to the offensive line was always lurking in the shadows.

Ultimately, Kyle Shanahan and John Lynch elected to address a need a year in advance, keying on Notre Dame tackle Mike McGlinchey to help solidify the future at tackle beyond Joe Staley and Trent Brown.

McGlinchey was the pick at No. 9, joining guard Joshua Garnett as the second offensive player to get taken by San Francisco in Round 1 since receiver A.J. Jenkins in 2012.

The 49ers passed on linebacker Tremaine Edmunds and safety Derwin James, who were still on the board. The 49ers also decided against trading back, even while UCLA quarterback Josh Rosen was still on the board.

Staley will turn 34 in August and was just given a significant bump from $11 million to $17.4 million over the final two years of his contract, which could be the final two seasons of his career.

Brown is entering a contract year and is coming off significant shoulder surgery that ended last season prematurely. And while Brown is considered supremely talented, questions have persisted about his commitment to conditioning and overall buy-in.

By taking McGlinchey, the 49ers potentially save themselves from having to pay Brown the market rate for a franchise tackle next spring, which could cost somewhere in the $14 to $16 million range annually, assuming Brown remained healthy and continued to develop as one of the league’s best at the position. McGlinchey would cost significantly less on his rookie contract.

Some prognosticators think McGlinchey best suited at right tackle given his somewhat limited athleticism, but he the 49ers likely envision him versatile enough to move to the left side once Staley calls it a career.