Substantially improve code generation for address exposed locals (aka fixed
authorChris Lattner <sabre@nondot.org>
Thu, 13 May 2004 07:40:27 +0000 (07:40 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 13 May 2004 07:40:27 +0000 (07:40 +0000)
commitcb2fd557eee69df671d43d8adf74ffe2a6d0cc2d
tree4566aeabc1673c20eb62ea337894df7ab60ff1c4
parent042896206475428d486073e1201b2a36713129ef
Substantially improve code generation for address exposed locals (aka fixed
sized allocas in the entry block).  Instead of generating code like this:

entry:
  reg1024 = ESP+1234
... (much later)
  *reg1024 = 17

Generate code that looks like this:
entry:
  (no code generated)
... (much later)
  t = ESP+1234
  *t = 17

The advantage being that we DRAMATICALLY reduce the register pressure for these
silly temporaries (they were all being spilled to the stack, resulting in very
silly code).  This is actually a manual implementation of rematerialization :)

I have a patch to fold the alloca address computation into loads & stores, which
will make this much better still, but just getting this right took way too much time
and I'm sleepy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13554 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/X86/InstSelectSimple.cpp
lib/Target/X86/X86ISelSimple.cpp