[llvm-dev] Llvm pass to remove temporaries

Régis Portalez via llvm-dev llvm-dev at lists.llvm.org
Sat Aug 29 04:50:11 PDT 2015

Hi James.

Thanks for the answer.

After the opt pass, I want to parse the generated IR. But when I run mem2reg, I'm getting values with valueTy set to 32, which is not in the ValuTy enum. I deduced those are instruction values. But I didn't find that much doc on those. That's why I'd like to stay in the "safe" zone and avoiding those vals.

Thanks again. 


-----Message d'origine-----
De : "James Molloy" <james at jamesmolloy.co.uk>
Envoyé : ‎29/‎08/‎2015 12:49
À : "Régis Portalez" <regis.portalez at altimesh.com>; "llvm-dev at lists.llvm.org" <llvm-dev at lists.llvm.org>
Objet : Re: [llvm-dev] Llvm pass to remove temporaries


mem2reg is what you want. Why are you worried about the generated IR looking different from the input source? don't you have to modify the IR to remove such temporaries?



On Fri, 28 Aug 2015 at 19:10 Régis Portalez <llvm-dev at lists.llvm.org> wrote:


I'm just starting to dig into the many existing llvm passes, and so far I didn't find what I'm looking for.

I generate llvm IR code in debug. I'd just like to go through this code and remove as many temporaries as possible. Those variables look generated for debug purposes.
They often look like synonyms of variables declared in the input source and don't seem to have a real meaning.

IR looks like:
Load a
Store b
Use b (instead of a)

I don't want to run something like mem2reg or simpilfycfg,, because the generated IR is too different from the input source.

Could someone please give me a hint?
LLVM Developers mailing list
llvm-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150829/89e88179/attachment.html>

More information about the llvm-dev mailing list