Hi CLaR,
If you are asking about whether the M25P40 memory capacity can fit the EP4CE10E22 (Cyclone IV) bitstream size, please refer to "Example 1" from the EPCS datasheet. The "Example 1" shows how you can calculate(estimate) the FPGA compress .rbf size to determine which EPCS device is suitable for FPGA device. The same calculation concept is applicable for other SPI flash too.
https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/cfg/cyc_c51014.pdf
Refer to Table 8–2 for the uncompressed Raw Binary File (.rbf) sizes for Cyclone IV devices from the Cyclone IV handbook in the following link:
https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/hb/cyclone-iv/cyiv-5v1.pdf
Regards,
Nooraini