I thought crypto mining is today done with ASICs, since CPUs and GPUs can't keep up in energy efficiency. Someone told me that mining Bitcoin using commercial power and ASICs has negative efficiency in most parts of the world, since you pay more for the kilowatts required than the resulting bitcoin sells for, and with CPUs it's hopeless. For other (less commonly used) cryptocurrencies, that may not be true. But the answer to this is to move to areas where power is either extremely cheap (for example due to lack of environmental regulations on coal), or where one can use crime or political connections to get free power. Supposedly that's the case in parts of the former Soviet Union and North Korea, where state-sponsored crypto mining gets free electricity, and the state gets a share of the cryptocurrency.
Another form of mining is to be a criminal: Just don't pay for computer power, and steal it. Rumor has it that the hosting- and cloud providers are having big problems with "customers" using free trial accounts and fake credit cards to buy computer power, using it to mine, and not paying their bills. I have not heard whether hackers are breaking into everyday computers and using background cycles to mine, but that sounds like another approach.
In all these cases, a few percent improvement in efficiency of the generated code that runs on mainstream CPUs is not the big issue ... the big issue is arrangements with politicians and avoiding law enforcement.
Where efficient compilers matter is for example two areas. The obvious one is supercomputers: if a government agency, university or company pays dozens or hundreds of M$ for a computer, they are keenly interested in making it run a few percent faster, since that translates into significant $ savings. The second one is the big hyperscalers (FAANG + friends, in particular the cloud providers): they spend billions on compute power, and compete with each other with razor-thin margins, so a few percent improvement can be make or break.