In this paper we propose a knowledge-based approach for solving data d
ependence testing and loop scheduling problems. A rule-based system, c
alled the K-Test, is developed by repertory grid and attribute ording
table to construct the knowledge base. The K-Test chooses an appropria
te testing algorithm according to some features of the input program b
y using knowledge-based techniques, and then applies the resulting tes
t to detect data dependences for loop parallelization. Another rule-ba
sed system, called the KPLS, is also proposed to be able to choose an
appropriate scheduling by inferring some features of loops and assign
parallel loops on multiprocessors for achieving high speedup. The expe
rimental results show that the graceful speedup obtained by our compil
er is obvious.