Sounds like you break a single getelementptr into a few smaller ones, then do CSE-like optimization? 2017-06-14 21:11 GMT+08:00 Krzysztof Parzyszek via llvm-dev < llvm-dev at lists.llvm.org>:> On 6/14/2017 7:44 AM, 陳韋任 via llvm-dev wrote: > >> >> Skim through Hexagon backend, I notice there is HexagonCommonGEP.cpp >> which seems >> try to do something on `getelementptr` LLVM instruction. But what exactly >> it want to do? >> Anyone knows? >> > > Each getelementptr is a chain that starts with a pointer, followed by an > index, which together produce a new pointer. That new pointer coupled with > the next index on the operand list produced yet another pointer, and so on. > Each GEP can actually be broken up into shorter GEPs, where the next one > starts at the address generated by the previous one. It is fairly common to > have GEP instructions that in their entirety generate different pointers, > but where the initial few pointers are identical. The core task of > HexagonCommonGEP is to isolate the initial identical addresses into their > own GEP instructions. It then does several other things, like finding the > best placement of the commoned GEPs (with respect to loop invariance), etc. > > -Krzysztof > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- Wei-Ren Chen (陳韋任) Homepage: https://people.cs.nctu.edu.tw/~chenwj -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170614/b567994c/attachment.html>
Krzysztof Parzyszek via llvm-dev
2017-Jun-14 13:51 UTC
[llvm-dev] What is HexagonCommonGEP.cpp for?
On 6/14/2017 8:16 AM, 陳韋任 wrote:> Sounds like you break a single getelementptr into a few smaller ones, > then do CSE-like optimization?Something like that. -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
I only see Hexagon has such optimization, is there any reason that Hexagon need this? No existing optimization does similar thing? Thanks, Regards, chenwj 2017-06-14 21:51 GMT+08:00 Krzysztof Parzyszek <kparzysz at codeaurora.org>:> On 6/14/2017 8:16 AM, 陳韋任 wrote: > >> Sounds like you break a single getelementptr into a few smaller ones, >> then do CSE-like optimization? >> > > Something like that. > > > -Krzysztof > > -- > Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted > by The Linux Foundation >-- Wei-Ren Chen (陳韋任) Homepage: https://people.cs.nctu.edu.tw/~chenwj -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170614/b5b24509/attachment-0001.html>