Good Morning - Happy Holidays everyone! I had a question about the best way to do back tracing of variables via the IR. So for example, if I have the following simple IR: define i32 @squak(i32 %num) #0 { %1 = alloca i32, align 4 store i32 %num, i32* %1, align 4 %2 = load i32, i32* %1, align 4 %3 = icmp sgt i32 %2, 10 I’m grabbing the predicate of “icmp”, which in this case is a simple test “>” of the input “%num" and the constant “10" and I want to trace back to “%num" via the slots/virtual registers %2 and %1. I believe I can do this via the SlotTracker (in AsmWriter.cpp) but I wonder if there’s a better, more direct way? Any suggestions? I’m basically trying to track predicate formation in the IR and hence the need… Thanks for any help!
Hi Juan: I haven't looked at SlotTracker, but have been using MemoryDependenceWrapperPass to do something similar. hth... don On Fri, Dec 23, 2016 at 5:55 AM, Juan Ceasar via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Good Morning - Happy Holidays everyone! > > I had a question about the best way to do back tracing of variables via > the IR. So for example, if I have the following simple IR: > > define i32 @squak(i32 %num) #0 { > %1 = alloca i32, align 4 > store i32 %num, i32* %1, align 4 > %2 = load i32, i32* %1, align 4 > %3 = icmp sgt i32 %2, 10 > > I’m grabbing the predicate of “icmp”, which in this case is a simple test > “>” of the input “%num" and the constant “10" and I want to trace back to > “%num" via the slots/virtual registers %2 and %1. I believe I can do this > via the SlotTracker (in AsmWriter.cpp) but I wonder if there’s a better, > more direct way? Any suggestions? I’m basically trying to track predicate > formation in the IR and hence the need… > > Thanks for any help! > > > _______________________________________________ > 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/20161223/ce16030e/attachment-0001.html>
Don, Thanks so much, I think that’s pretty much what I was looking for!> On Dec 23, 2016, at 10:25 AM, don hinton <hintonda at gmail.com> wrote: > > Hi Juan: > > I haven't looked at SlotTracker, but have been using MemoryDependenceWrapperPass to do something similar. > > hth... > don > > On Fri, Dec 23, 2016 at 5:55 AM, Juan Ceasar via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote: > Good Morning - Happy Holidays everyone! > > I had a question about the best way to do back tracing of variables via the IR. So for example, if I have the following simple IR: > > define i32 @squak(i32 %num) #0 { > %1 = alloca i32, align 4 > store i32 %num, i32* %1, align 4 > %2 = load i32, i32* %1, align 4 > %3 = icmp sgt i32 %2, 10 > > I’m grabbing the predicate of “icmp”, which in this case is a simple test “>” of the input “%num" and the constant “10" and I want to trace back to “%num" via the slots/virtual registers %2 and %1. I believe I can do this via the SlotTracker (in AsmWriter.cpp) but I wonder if there’s a better, more direct way? Any suggestions? I’m basically trying to track predicate formation in the IR and hence the need… > > Thanks for any help! > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <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/20161224/f9657375/attachment.html>