[LLVMdev] Problem while using mem2reg Optimization

Matthijs Kooijman matthijs at stdin.nl
Thu Jul 3 00:43:35 PDT 2008


> Yes, there is exactly such a restriction;
> http://llvm.org/docs/tutorial/LangImpl7.html has a good description of
> using mem2reg for SSA construction.
From that page:
"mem2reg only looks for alloca instructions in the entry block of the
function. Being in the entry block guarantees that the alloca is only executed
once, which makes analysis simpler."

I was thinking you could just move any alloca to the entry block for free, but
I hadn't considered looping.

Gr.

Matthijs
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20080703/f49ee076/attachment.sig>


More information about the llvm-dev mailing list