Rory McIlroy hit the flag from the rough from 165 yards out to set up the birdie putt on his opening round of the PGA Championship.