A friend of mine tried Optane SSD and he didn't notice any performance increase in software compilation or anything else comparing to 960 SSD from Samsung. So I don't expect to get much from such upgrade and will just keep my current 981 SSD.
Compilation itself, no. However, linking can be very I/O-intensive, particularly if using static linking of large libraries. And packaging up of build products at the end of the process. These can often be serial rate-limiting steps in comparison with parallelised compilation, so can end up taking a disproportionate fraction of the total wall clock time.
While it can clearly vary widely depending upon the nature of what you are building, it can in some cases be worth using faster storage to shave many tens of minutes off the build time.