memory access after optimization

Hi everyone,

I was wondering how memory is accessed after optimizing the code. In other words, are memory accesses done via load and store instructions even at optimization level O2 or other instructions (can) access memory too?



You need to say what kind of code representation you are talking about.

LLVM IR always uses pure loads and stores to or from virtual (unlimited) registers.

Code generated for RISC architectures such as ARM or PowerPC always uses pure loads and stores, as that is all they have.

Code generated for CISC architectures such as x86 combines loads and stores with arithmetic instructions when appropriate.