On Mon, Jul 11, 2016 at 2:20 PM, Krzysztof Parzyszek via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On 7/11/2016 3:27 PM, Phil Tomson via llvm-dev wrote: > >> >> I guess I'm a bit surprised that -O3 wouldn't automatically do what I've >> done in the second version of the C code when generating code from the >> first version? >> > > This is most likely because a, b, and c are assumed to be aliased. >In the context of this particular function wouldn't alias analysis be able to figure out that there is no alias to a? Although, I guess considering the possibility of multi-threading it might be difficult to make that determination in all other parts of the program. Phil> > -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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160711/d4328410/attachment.html>
Krzysztof Parzyszek via llvm-dev
2016-Jul-12 18:58 UTC
[llvm-dev] extra loads in nested for-loop
On 7/11/2016 6:21 PM, Phil Tomson wrote:> > In the context of this particular function wouldn't alias analysis be > able to figure out that there is no alias to a?They are function parameters, so there is no way to tell if they are aliased or by looking at the function's body. You can try using "restrict" to tell the compiler that they are not, if that is the case in your program. -Krzysztof -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Daniel Berlin via llvm-dev
2016-Jul-12 19:08 UTC
[llvm-dev] extra loads in nested for-loop
Right, it's literally not possible to say these are not aliased without help :) On Tue, Jul 12, 2016 at 11:58 AM, Krzysztof Parzyszek via llvm-dev < llvm-dev at lists.llvm.org> wrote:> On 7/11/2016 6:21 PM, Phil Tomson wrote: > >> >> In the context of this particular function wouldn't alias analysis be >> able to figure out that there is no alias to a? >> > > They are function parameters, so there is no way to tell if they are > aliased or by looking at the function's body. You can try using "restrict" > to tell the compiler that they are not, if that is the case in your program. > > > -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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160712/31521a5e/attachment.html>