Rafael Devers hit a three-run homer and finished with four RBIs and Tyler Mahle struck out six through 5 2/3 scoreless innings as the San Francisco Giants defeated the Philadelphia Phillies 5-0.