Neil Ryan via llvm-dev
2019-Apr-16 18:38 UTC
[llvm-dev] Disable combining of loads and stores in instcombine
LLVM's optimizer combines stores to consecutive characters into a write of a single word. For instance, if I have char A[4] and I write some static value to each element, these writes would be combined into a single 32-bit word write. I found this thread from 2009 -- it seems like it wasn't possible then. Has anything changed since? Neil -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190416/2168fdb7/attachment.html>
Tom Stellard via llvm-dev
2019-Apr-17 03:16 UTC
[llvm-dev] Disable combining of loads and stores in instcombine
On 04/16/2019 11:38 AM, Neil Ryan via llvm-dev wrote:> LLVM's optimizer combines stores to consecutive characters into a write of a single word. For instance, if I have char A[4] and I write some static value to each element, these writes would be combined into a single 32-bit word write. I found this thread <http://llvm.1065342.n5.nabble.com/disabling-combining-load-stores-in-optimizer-td37560.html> from 2009 -- it seems like it wasn't possible then. Has anything changed since? >Why do you want to disable this optimization? -Tom> Neil > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >
Neil Ryan via llvm-dev
2019-Apr-17 04:11 UTC
[llvm-dev] Disable combining of loads and stores in instcombine
I’m writing a pass for some custom hardware — we’d like to split arrays across hardware elements; this doesn’t work if consecutive writes to characters get combined to a word. On Apr 16, 2019, 8:17 PM -0700, Tom Stellard <tstellar at redhat.com>, wrote:> On 04/16/2019 11:38 AM, Neil Ryan via llvm-dev wrote: > > LLVM's optimizer combines stores to consecutive characters into a write of a single word. For instance, if I have char A[4] and I write some static value to each element, these writes would be combined into a single 32-bit word write. I found this thread <http://llvm.1065342.n5.nabble.com/disabling-combining-load-stores-in-optimizer-td37560.html> from 2009 -- it seems like it wasn't possible then. Has anything changed since? > > > > Why do you want to disable this optimization? > > -Tom > > > > Neil > > > > > > _______________________________________________ > > LLVM Developers mailing list > > llvm-dev at lists.llvm.org > > https://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/20190416/c52265b4/attachment.html>
Arsenault, Matthew via llvm-dev
2019-Apr-17 12:02 UTC
[llvm-dev] Disable combining of loads and stores in instcombine
This won’t happen with volatile load/store -Matt From: llvm-dev <llvm-dev-bounces at lists.llvm.org> on behalf of llvm-dev <llvm-dev at lists.llvm.org> Reply-To: Neil Ryan <neilryan at cs.washington.edu> Date: Tuesday, April 16, 2019 at 9:01 PM To: llvm-dev <llvm-dev at lists.llvm.org> Subject: [llvm-dev] Disable combining of loads and stores in instcombine LLVM's optimizer combines stores to consecutive characters into a write of a single word. For instance, if I have char A[4] and I write some static value to each element, these writes would be combined into a single 32-bit word write. I found this thread<http://llvm.1065342.n5.nabble.com/disabling-combining-load-stores-in-optimizer-td37560.html> from 2009 -- it seems like it wasn't possible then. Has anything changed since? Neil -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190417/56b9f3ab/attachment.html>
JF Bastien via llvm-dev
2019-Apr-17 16:35 UTC
[llvm-dev] Disable combining of loads and stores in instcombine
> On Apr 17, 2019, at 5:02 AM, Arsenault, Matthew via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > This won’t happen with volatile load/storeThis is mostly true today, but AFAICT the LLVM memory model doesn’t actually offer this guarantee. It merely says that LLVM treats volatile like C / C++ treats volatile… which isn’t much of a guarantee because C / C++ volatile doesn’t normatively mean anything. Specifically, we cannot really honor this when volatile bitfields are used for which memory operations don’t exist: struct { volatile int a : 12; volatile int b : 4; } s; As things stand, we haven’t promised that we won’t combine adjacent volatile stores, and C / C++ certainly allow us to do so. I don’t think it would be a good idea to do so, but we certainly could.> -Matt > > From: llvm-dev <llvm-dev-bounces at lists.llvm.org> on behalf of llvm-dev <llvm-dev at lists.llvm.org> > Reply-To: Neil Ryan <neilryan at cs.washington.edu> > Date: Tuesday, April 16, 2019 at 9:01 PM > To: llvm-dev <llvm-dev at lists.llvm.org> > Subject: [llvm-dev] Disable combining of loads and stores in instcombine > > LLVM's optimizer combines stores to consecutive characters into a write of a single word. For instance, if I have char A[4] and I write some static value to each element, these writes would be combined into a single 32-bit word write. I found this thread <http://llvm.1065342.n5.nabble.com/disabling-combining-load-stores-in-optimizer-td37560.html> from 2009 -- it seems like it wasn't possible then. Has anything changed since? > > Neil > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://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/20190417/ae24e187/attachment.html>