I usually mash a little bit at the start of a hill and then downshift a bit to keep my cadence where i like it. As the hill gets steeper then downshift again till I'm in my lowest gear and grind from there. I try not to waste too much energy in the beginning by mashing therefore shifting to lower gears earlier on. Pulling up on my pedals helps a bit also. Trying not to use all your energy on the hill but save it for the flats where you can go faster for longer periods of time is my motto...