Eric Lu
2015-Apr-22 05:10 UTC
[LLVMdev] what is the Line number of Phi Node with addr2line
Hi, Daniel I want to profile load/store operations, in order to reduce the overhead of profiling, I try to instrument the optimized llvm ir, which has phi nodes. BTW, when the value of some load/store operations may have multi-source, then the load will be translated into phi nodes, and all phi nodes are placed in the front of BB. Sometimes, the position is not where the load happens, is there any way to figure out where the load should be placed?( If the phi node translated back to load operations) Best Regards! Eric Lew On 周三, 4月 22, 2015 at 12:24 下午, Daniel Berlin <dberlin at dberlin.org> wrote: Hey Eric, phi nodes don't exist for real, so you can't. The are removed by PHI elimination as part of codegen. What are you trying to achieve? On Tue, Apr 21, 2015 at 9:12 PM, Eric Lu <eirc.lew at gmail.com> wrote:> Hi, all > > When compiling a program with -g -O0, and if we have a PC, then with > addr2line, we can get the line number of the instruction. > > My quesions are: what is the result of Phi node instruction, can we getthe> similar results ? > > -- > Best Regards! > Eric Lew > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150422/fa9356e5/attachment.html>
Eric Lu
2015-Apr-22 05:14 UTC
[LLVMdev] what is the Line number of Phi Node with addr2line
By the way. When I remove these phi nodes with -reg2mem, some new load operations will be inserted, but when I try cache load operations with: visitFunction visitLoadInst It seems we can't see these new load operations. On Wed, Apr 22, 2015 at 1:10 PM, Eric Lu <eirc.lew at gmail.com> wrote:> Hi, Daniel > > I want to profile load/store operations, in order to reduce the overhead > of profiling, I try to instrument the optimized llvm ir, which has phi > nodes. > > BTW, when the value of some load/store operations may have multi-source, > then the load will be translated into phi nodes, and all phi nodes are > placed in the front of BB. Sometimes, the position is not where the load > happens, is there any way to figure out where the load should be placed?( > If the phi node translated back to load operations) > > Best Regards! > Eric Lew > On 周三, 4月 22, 2015 at 12:24 下午, Daniel Berlin <dberlin at dberlin.org> wrote: > > Hey Eric, > phi nodes don't exist for real, so you can't. > The are removed by PHI elimination as part of codegen. > > What are you trying to achieve? > > > > > On Tue, Apr 21, 2015 at 9:12 PM, Eric Lu <eirc.lew at gmail.com> wrote: > > Hi, all > > > > When compiling a program with -g -O0, and if we have a PC, then with > > addr2line, we can get the line number of the instruction. > > > > My quesions are: what is the result of Phi node instruction, can we get > the > > similar results ? > > > > -- > > Best Regards! > > Eric Lew > > > > _______________________________________________ > > LLVM Developers mailing list > > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > > > >-- Best Regards! Eric Lew -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150422/58a336ff/attachment.html>
Daniel Berlin
2015-Apr-22 05:19 UTC
[LLVMdev] what is the Line number of Phi Node with addr2line
On Tue, Apr 21, 2015 at 10:10 PM, Eric Lu <eirc.lew at gmail.com> wrote:> Hi, Daniel > > I want to profile load/store operations, in order to reduce the overhead of > profiling, I try to instrument the optimized llvm ir, which has phi nodes.Sure, but if you use -g, it also has debug info metadata attached to stuff, and will get mostly right answers attached to the output.>> BTW, when the value of some load/store operations may have multi-source, > then the load will be translated into phi nodes, and all phi nodes are > placed in the front of BB. Sometimes, the position is not where the load > happens, is there any way to figure out where the load should be placed?( If > the phi node translated back to load operations)Can you show me a code example, and i can give you an answer on how to place them :)> > Best Regards! > Eric Lew > > On 周三, 4月 22, 2015 at 12:24 下午, Daniel Berlin <dberlin at dberlin.org> wrote: > > Hey Eric, > phi nodes don't exist for real, so you can't. > The are removed by PHI elimination as part of codegen. > > What are you trying to achieve? > > > > > On Tue, Apr 21, 2015 at 9:12 PM, Eric Lu <eirc.lew at gmail.com> wrote: >> Hi, all >> >> When compiling a program with -g -O0, and if we have a PC, then with >> addr2line, we can get the line number of the instruction. >> >> My quesions are: what is the result of Phi node instruction, can we get >> the >> similar results ? >> >> -- >> Best Regards! >> Eric Lew >> >> _______________________________________________ >> LLVM Developers mailing list >> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >>
Daniel Berlin
2015-Apr-22 05:23 UTC
[LLVMdev] what is the Line number of Phi Node with addr2line
reg2mem does not eliminate phi nodes the way codegen does, it just converts ssa values to non-ssa values. It's not the same thing. On Tue, Apr 21, 2015 at 10:14 PM, Eric Lu <eirc.lew at gmail.com> wrote:> By the way. When I remove these phi nodes with -reg2mem, some new load > operations will be inserted, but when I try cache load operations with: > visitFunction > visitLoadInst > It seems we can't see these new load operations. > > On Wed, Apr 22, 2015 at 1:10 PM, Eric Lu <eirc.lew at gmail.com> wrote: >> >> Hi, Daniel >> >> I want to profile load/store operations, in order to reduce the overhead >> of profiling, I try to instrument the optimized llvm ir, which has phi >> nodes. >> >> BTW, when the value of some load/store operations may have multi-source, >> then the load will be translated into phi nodes, and all phi nodes are >> placed in the front of BB. Sometimes, the position is not where the load >> happens, is there any way to figure out where the load should be placed?( If >> the phi node translated back to load operations) >> >> Best Regards! >> Eric Lew >> >> On 周三, 4月 22, 2015 at 12:24 下午, Daniel Berlin <dberlin at dberlin.org> wrote: >> >> Hey Eric, >> phi nodes don't exist for real, so you can't. >> The are removed by PHI elimination as part of codegen. >> >> What are you trying to achieve? >> >> >> >> >> On Tue, Apr 21, 2015 at 9:12 PM, Eric Lu <eirc.lew at gmail.com> wrote: >> > Hi, all >> > >> > When compiling a program with -g -O0, and if we have a PC, then with >> > addr2line, we can get the line number of the instruction. >> > >> > My quesions are: what is the result of Phi node instruction, can we get >> > the >> > similar results ? >> > >> > -- >> > Best Regards! >> > Eric Lew >> > >> > _______________________________________________ >> > LLVM Developers mailing list >> > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu >> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >> > > > > > > -- > Best Regards! > Eric Lew
Apparently Analagous Threads
- [LLVMdev] what is the Line number of Phi Node with addr2line
- [LLVMdev] what is the Line number of Phi Node with addr2line
- [LLVMdev] Use clang to generate LLVM IR with -O3, how to visit these load operations after -reg2mem
- [LLVMdev] Use clang to generate LLVM IR with -O3, how to visit these load operations after -reg2mem
- [LLVMdev] does clang and llvm take more time to compile c code