def trans(psy):
    """removes the grad_p halo exchanges by redundant computation then
    moves the remaining halo exchanges to the beginning of the invoke
    call"""
    from psyclone.transformations import Dynamo0p3RedundantComputationTrans, MoveTrans
    rc_trans = Dynamo0p3RedundantComputationTrans()
    m_trans = MoveTrans()
    invoke = psy.invokes.invoke_list[0]
    schedule = invoke.schedule
    schedule, _ = rc_trans.apply(schedule.children[5], {'depth': 2})
    schedule, _ = rc_trans.apply(schedule.children[0], {'depth': 2})
    schedule, _ = m_trans.apply(schedule.children[0], schedule.children[4])
    return psy
