  Dynamically formed black hole (BH) binaries (BBHs) are important sources of
gravitational waves (GWs). Globular clusters (GCs) provide a major environment
to produce such BBHs, but the total mass of the known GCs is small compared to
that in the Galaxy; thus, the fraction of BBHs formed in GCs is also small.
However, this assumes that GCs contain a canonical initial mass function (IMF)
similar to that of field stars. This might not be true because several studies
suggest that extreme dense and metal-poor environment can result in top-heavy
IMFs, where GCs may originate. Although GCs with top-heavy IMFs were easily
disrupted or have become dark clusters, the contribution to the GW sources can
be significant. Using a high-performance and accurate $N$-body code,
\textsc{petar}, we investigate the effect of varying IMFs by carrying out four
star-by-star simulations of dense GCs with the initial mass of $5\times10^5
M_\odot$ and the half-mass radius of $2$~pc. We find that the BBH merger rate
does not monotonically correlate with the slope of IMFs. Due to a rapid
expansion, top-heavy IMFs lead to less efficient formation of merging BBHs. The
formation rate continuously decreases as the cluster expands because of the
dynamical heating caused by BHs. However, in star clusters with a top-heavier
IMF, the total number of BHs is larger, and therefore, the final contribution
to merging BBHs can still be more than from clusters with the standard IMF, if
the initial cluster mass and density is higher than those used in our model.
