This paper studies an multi-cluster over-the-air computation (AirComp) system, where an intelligent reflecting surface (IRS) assists the signal transmission from devices to an access point (AP). The clusters are activated to compute heterogeneous functions in a time-division manner. Specifically, two types of IRS beamforming (BF) schemes are proposed to reveal the performancecost tradeoff. One is the cluster-adaptive BF scheme, where each BF pattern is dedicated to one cluster, and the other is the dynamic BF scheme, which is applied to any number of IRS BF patterns. By deeply exploiting their inherent properties, both generic and lowcomplexity algorithms are proposed in which the IRS BF patterns, time and power resource allocation are jointly optimized. Numerical results show that IRS can significantly enhance the function computation performance, and demonstrate that the dynamic IRS BF scheme with half of the total IRS BF patterns can achieve near-optimal performance which can be deemed as a cost-efficient approach for IRS-aided multi-cluster AirComp systems.