def get_unrollable_gemm_ops(R):
    """Get all GEMM operators from the final reduction
    This is a helper function to more easily get all the GEMM operations
    from an operator

    Parameters
    ----------
    R : tvm.te.Tensor
        Reduced tensor, final stage of GEMM

    Returns
    -------
    A_unrolled : tvm.te.Tensor
        Matrix A unrolled along k

    B_unrolled: tvm.te.Tensor
        Matrix B unrolled along k

    C : tvm.te.Tensor
        Result of batched GEMM

    R : tvm.te.Tensor
        Reduction of C, result of unrollable GEMM

    """
    C = R.op.input_tensors[0]
    A_unrolled, B_unrolled = C.op.input_tensors
    return A_unrolled, B_unrolled, C, R