So my question is, why JVM doesn't compile incrementing a int variable
operation to an atomic Fetch-and-Increment operation that CPUs
support, which could be useful in multi-thread programming.
Besides the obvious answer that the JVM may need to target hardware that lacks such native instructions, I want to address the more general, "Why not make every primitive operation atomic even if all the targeted hardware supports it?"
Thread safety != Thread Efficiency
Whenever you involve an atomic operation like fetch-and-add/inc in hardware that supports it, there is a need for a potentially far more expensive set of instructions.
With such costs, imagine using an atomic fetch-and-add to simply increment the counter in a massive loop doing very light work per iteration. Such an introduction could degrade the performance of the loop drastically to a point where the program is slowed to a fraction of its original speed.
Thread efficiency, by nature, often requires a large portion of your codebase to lack thread safety, as in the above example with the loop counter. Ideally all the code that is only going to be used by a single thread should be thread-unsafe. It shouldn't be paying the cost of locking and synchronization in places that don't need it.
We're far from the point where we have such smart compilers that can anticipate whether an operation is going to require thread safety/atomicity or not. So thread efficiency is often in the hands of the programmer for the time being, and thread-safety along with it.