In this paper, we present a compiling approach for exploiting AND-parallelism in logic programs. The approach consists of three phases: analysis of entry modes; derivation of exit modes; and determination of execution graph expressions. Compared with other approaches, this approach, with the compile-time program-level data-dependence analysis of logic programs, can more efficiently exploit AND-parallelism in logic programs. Two precompilers, based on our approach and DeGroot's approach respectively, have been implemented in the SES-PIM system. Through compiling and running some typical benchmarks in SES-PIM, we conclude that our approach can, in most cases, exploit as much AND-parallelism as the dynamic approach does under 'producer-consumer' scheme, and needs less dynamic overhead while exploiting more AND-parallelism than DeGroot's approach.