A caveat: the critical mass changes with density only if the change in density changes the surface through which the neutrons can escape. The critical surface density is independent on the volume density!
For example, the bare sphere critical mass of uranium 235 at ordinary density is 52 kg. Medium enriched uranium to 20 % is said to have critical mass of 400 kg for bare sphere, containing 80 kg uranium 235.
If you could somehow compress uranium to double its normal density while keeping same spherical shape as before, its critical mass would decrease 4 times. For example, if you could compress an 100 kg sphere of uranium into double its original density, the 100 kg sphere would take up as much space as an uncompressed 50 kg sphere. Its diametre would be 2 times smaller tan that of uncompressed 400 kg sphere, its surface area 4 times smaller, so the ratio of its mass to surface area would be the same as that of the uncompressed 400 kg sphere and it could go critical under the same conditions (20 % enrichment).
Note that it only helps if the uranium is sufficiently enriched. The critical mass of uranium diverges to infinity somewhere around 6 % uranium 235. 1/4 of infinity is still infinity. The chain reaction is stopped by absorption in uranium 238 alone, even if escape of neutrons is completely stopped.
But now imagine that you change the density but do NOT diminish the surface area.
Say, you put a fusion bomb inside a fissile uranium shell, which is not critical.
Then the bomb inside explodes. It also is a neutron source. When a triton fuses with a deuteron, it produces 17,6 MeV energy, 14 MeV of which are given to neutron.
If the neutron were to fiss a uranium nucleus, whether uranium 238 or 235, it could release about 200 MeV energy, which is over 10 times the yield of the original fusion event;
if the neutron could initiate a convergent fission chain reaction in a subcritical but nearly critical fissile shell, it would produce several times the energy of one fission
and if the fissile material were made supercritical by compression then a single neutron or spontaneous fission could produce lots of energy.
But critical mass is only diminished by decrease of surface!
If you have an uranium shell around a fusion bomb, then even if the uranium shell were compressed to 1000 times into its original density as the thermonuclear explosion shock wave sweeps it up, it is compressed into a thin metal sheet. Its surface area through which neutrons may escape is not diminished, so if it is not critical before, it is not made any more critical by any amount of compression.
Now, if you put the fissile subcritical uranium assembly inside a fusion bomb then yes, you could make it critical if it is subcritical before, or else you could make it nearly critical where it is far from critical before. But note that you are making the neutrons less likely to hit it by diminishing its outer surface!