In this paper, compute-and-forward physical layer network coding (PNC) scheme is investigated for wireless twoway relay channel. The achievable rates are reviewed both for AWGN channel and fading channel. New transmit schemes by using channel inversion precoding are proposed over fading channel to achieve much higher rates. It is revealed that with the proposed channel aware precoding scheme, the performance of compute-and-forward improves enormously. For two-way relay channel, compute-and-forward can achieve the maximum degree of freedom (DoF) of 2 without the limitation of Diophantine tradeoff, which indicates that compute-and-forward is the most suitable relaying scheme for two-way relay channel.