[LLVMdev] Keeping values in memory

Nicolas Capens nicolas at capens.net
Fri Sep 5 07:06:02 PDT 2008


Hi all,

 

It looks like LLVM is quite eager to load values into registers when they
have multiple uses. Unfortunately, this increases register pressure,
specifically on x86. In my experience modern x86 processors are very capable
of using memory operands as source. In fact the only cases where a register
is preferred over repeatedly using the same memory operand is when multiple
instructions could use the value in the same clock cycle, or when it
significantly reduces code size.

 

I have found this to be mostly a concern with SIMD code (MMX and SSE). So if
anyone could tell me where to find the code that determines whether to load
a value into a register or leave it in memory, I could perform some tests to
see if a better heuristic exists.

 

Thanks,

 

Nicolas Capens

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080905/bed8c71a/attachment.html>


More information about the llvm-dev mailing list