Régis Portalez via llvm-dev
2015-Aug-28 18:09 UTC
[llvm-dev] Llvm pass to remove temporaries
Hi. 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? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150828/c3078795/attachment.html>
James Molloy via llvm-dev
2015-Aug-29 10:49 UTC
[llvm-dev] Llvm pass to remove temporaries
Hi, 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? Cheers, James On Fri, 28 Aug 2015 at 19:10 Régis Portalez <llvm-dev at lists.llvm.org> wrote:> Hi. > > 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 > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150829/1bb1ecb8/attachment.html>
Régis Portalez via llvm-dev
2015-Aug-29 11:50 UTC
[llvm-dev] Llvm pass to remove temporaries
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. Regis -----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 Hi, 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? Cheers, James On Fri, 28 Aug 2015 at 19:10 Régis Portalez <llvm-dev at lists.llvm.org> wrote: Hi. 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 http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150829/89e88179/attachment.html>
Apparently Analagous Threads
- get llvm IR after a clang optimization pass.
- [LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR
- vectorization for X86
- [LLVMdev] obtain the address and size of LLVM generated temporaries
- [LLVMdev] get the identifies of the unnamed temporaries from the instruction of LLVM IR