CaAlSi is a layered silicide with the AlB 2 -structure and shows superconductivity below 7.7 K. The angular dependence of the upper critical field, H c2 (y), in CaAlSi shows a cusp-like anomaly, suggesting the presence of decoupled two-dimensional superconducting layers. Concomitant with this feature, a strong lattice modulation along the c-axis exists in this material. On the other hand, H c2 (y) in CaGaSi is well fitted by the anisotropic Ginzburg-Landau (GL) model, and the superstructure along the c-axis is absent. In order to get some insight into the origin of the anomalous H c2 (y) in CaAlSi, we have performed magneto-optical observations of the vortex penetration for fields applied parallel and perpendicular to the c-axis. Vortices are found to penetrate the crystal inhomogeneously when the field is applied perpendicular to the c-axis, indicating the presence of macroscopic inhomogeneities in CaAlSi. We have also grown single crystals of CaAl 1Àx Ga x Si and studied the evolution of anomalous H c2 (y) and the lattice modulation along the c-axis. With increasing Ga content in CaAl 1Àx Ga x Si, the superstructure along the c-axis survives up to x ¼ 0.2, although the anomaly in H c2 (y) is strongly suppressed. It may suggest irrelevance of the two features, although it seems to be closely correlated in CaAlSi and CaGaSi. Possible scenarios for the appearance of the anomalous H c2 (y) are proposed. r