Displaying 20 results from an estimated 20000 matches similar to: "What is the right lowering for misaligned memory access?"
2016 Jan 15
3
[cfe-dev] RFC: Enforcing pointer type alignment in Clang
> On Jan 14, 2016, at 4:49 PM, Richard Smith <richard at metafoo.co.uk> wrote:
> On Thu, Jan 14, 2016 at 12:56 PM, John McCall via cfe-dev <cfe-dev at lists.llvm.org <mailto:cfe-dev at lists.llvm.org>> wrote:
> C 6.3.2.3p7 (N1548) says:
> A pointer to an object type may be converted to a pointer to a
> different object type. If the resulting pointer is not
2016 Jan 15
2
[cfe-dev] RFC: Enforcing pointer type alignment in Clang
(Sorry for the duplicate mail, Richard, I accidentally sent a copy only to
you before.)
On Thu, Jan 14, 2016 at 10:26 PM, Richard Smith via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> [1]: That's not completely true, as it's possible to create an object
> that is underaligned for its type:
>
> struct __attribute__((packed)) A {
> char k;
> struct B { int n;
2016 Jan 14
8
RFC: Enforcing pointer type alignment in Clang
C 6.3.2.3p7 (N1548) says:
A pointer to an object type may be converted to a pointer to a
different object type. If the resulting pointer is not correctly
aligned) for the referenced type, the behavior is undefined.
C++ [expr.reinterpret.cast]p7 (N4527) defines pointer conversions in terms
of conversions from void*:
An object pointer can be explicitly converted to an object pointer
of a
2007 Aug 07
2
`*deleting' itemize output misaligned
Wayne,
I noticed that rsync's "*deleting" itemize output needs two trailing
spaces now that the other itemize codes are 11 characters wide. See
the patch below.
Matt
-------------
Index: log.c
===================================================================
RCS file: /cvsroot/rsync/log.c,v
retrieving revision 1.179
diff -u -r1.179 log.c
--- log.c 10 Jul 2007 13:55:49
2020 May 26
2
Emitting aligned nlist_64 structures for Mach-O in MC
As part of our work on LLD for Mach-O, we’ve observed that the object files produced by LLVM don’t always have aligned nlist_64 entries. For context, nlist_64 is the 64-bit symbol table entry structure for Mach-O, and the symbol table is an array of nlist_64 entries. nlist_64 has an 8 byte member, so it should be 8-byte aligned, but we’ve seen object files where the symbol table only has a 4-byte
2020 May 26
2
Emitting aligned nlist_64 structures for Mach-O in MC
I looked into this further. ld64 has a macho_nlist abstraction over the various underlying nlist structures [1]. On x86-64, the P::getP referenced in n_value will resolve to [2], which in turn goes to [3], which calls OSReadLittleInt64. On a little endian machine, OSReadLittleEndian just calls _OSReadInt64 [4], which in turn does a pointer arithmetic and cast and then dereferences the pointer [5].
2013 Jul 21
2
[LLVMdev] Disable vectorization for unaligned data
Ok any quick workaround to limit vectorization to 16-byte aligned 128-bit
data then?
All the memory copying done by ExpandUnalignedStore/ExpandUnalignedLoad is
just too expensive.
On Sat, Jul 20, 2013 at 12:52 PM, Arnold Schwaighofer <
aschwaighofer at apple.com> wrote:
>
> On Jul 19, 2013, at 3:14 PM, Francois Pichet <pichet2000 at gmail.com> wrote:
>
> >
> >
2016 Jan 27
7
Adding sanity to the Atomics implementation
Right now, the atomics implementation in clang is a bit of a mess. It has three basically completely distinct code-paths:
There's the legacy __sync_* builtins, which clang lowers directly to atomic IR instructions. Then, the llvm atomic IR instructions themselves can sometimes emit libcalls to __sync_* library functions (which are basically undocumented, and users are often responsible for
2013 Jul 21
1
[LLVMdev] Disable vectorization for unaligned data
If I got you right, this is the classic case for loop peeling. I thought
LLVM's vectorizer had something like that already in.
On 21 July 2013 18:16, Arnold Schwaighofer <aschwaighofer at apple.com> wrote:
> I will have to work on this soon as ARM also has pretty inefficient
> unaligned vector loads.
>
NEON does support unaligned access via VLD*/VST*, what loads are you
2014 Dec 05
3
[LLVMdev] Memset/memcpy: user control of loop-idiom recognizer
On 3 Dec 2014, at 23:36, Robert Lougher <rob.lougher at gmail.com> wrote:
> On 2 December 2014 at 22:18, Alex Rosenberg <alexr at leftfield.org> wrote:
>>
>> Our C library amplifies this problem by being in a dynamic library, so the
>> call has additional overhead, which for small trip counts swamps the
>> copy/set.
>>
>
> I can't imagine
2017 Jun 15
9
About CodeGen quality
Hi Mats,
It's private backend. I will try describing what I am dealing with.
struct S {
unsigned int a : 8;
unsigned int b : 8;
unsigned int c : 8;
unsigned int d : 8;
unsigned int e;
}
We want to read S->b for example. The size of struct S is 64 bits, and
seems LLVM treats it as i64.
Below is the IR corresponding to S->b, IIRC.
%0 = load
2018 Apr 18
2
[cfe-dev] RFC: Implementing -fno-delete-null-pointer-checks in clang
I'm working with an embedded architecture that could, in some situations,
run faster if code or data could be located at address zero. I don't know
whether this applies to other embedded chips.
Despite the name, the flag actually has rather straightforward semantics
> from the compiler's perspective. From the gcc docs for
> -fdelete-null-pointer-checks: "Assume that
2018 Apr 19
3
[cfe-dev] RFC: Implementing -fno-delete-null-pointer-checks in clang
On 4/19/2018 11:48 AM, Manoj Gupta via llvm-dev wrote:
> On Wed, Apr 18, 2018 at 12:54 PM Tim Northover
> <t.p.northover at gmail.com <mailto:t.p.northover at gmail.com>> wrote:
>
>
> On Wed, Apr 18, 2018 at 12:02 PM Friedman, Eli
> <efriedma at codeaurora.org <mailto:efriedma at codeaurora.org>> wrote:
>
> > Despite the name, the
2015 Sep 01
2
Do Frontends need to care about alignment?
Meant to add more text, but somehow the email got sent.
Could you explain why for some of these cases? If I set the right target
and only want to operate with the system C ABI, will LLVM not generate
correct code if I want to pay say structs to a system defined function?
I see clang specifying alignment, but I'm not sure why.
I want to understand beyond alignment and function ABI (which for
2011 Feb 28
2
[LLVMdev] Use of movupd instead of movapd for x86
Understood for the aligned case, I want to measure performance degradation for unaligned case.
I mean unaligned case versus aligned. I know this is stupid, but I want to try to pass a <4 x float>* as parameter of a routine and at the call site I want to pass a misaligned pointer. Since LLVM is generating movapd instruction it will raise an exception (SEGFAULT), I just want to know if there
2012 Jan 24
3
[LLVMdev] Use of 'ldrd' instructions with unaligned addresses on armv7 (Major bug in LLVM optimizer?)
In practice all Apple hardwares support misaligned accesses for single-register loads and stores.
If a pointer is not aligned, LLVM should not use the double-register loads and stores. It should keep the two single-register loads instead of trying to optimize them as one unsupported double-register load.
Note that this code compiled with GCC 4.2 runs perfectly whereas LLVM will produce a binary
2006 Jan 06
2
Re: sigsegv in _mm_load_ups (linux/gcc 3.x)
> I've seen the exact same in my version (mingw on win32), and the problem
> was that the stack was misaligned when entering the function, so the temp
> registers weren't at 16-byte boundries.
That's a possibility. It's easy to check by printing the address of the
variables. I know that gcc 3.3 had some alignment issues with _m128 that
were supposed to be fixed in
2013 Jul 21
0
[LLVMdev] Disable vectorization for unaligned data
No, I am afraid not without computing alignment based on the scalar code.
In order to limit vectorization to 16-byte aligned data we need to know that data is 16-byte aligned. The way we vectorize we won’t know that until after we have vectorized. As you have observed we will pass “4” to getMemoryOpCost in the loop vectorizer (as that is the only thing that can be inferred from a consecutive
2018 Mar 12
3
Re: [PATCH v4 0/3] v2v: Add -o rhv-upload output mode.
On Mon, Mar 12, 2018 at 12:32 PM Richard W.M. Jones <rjones@redhat.com>
wrote:
> On Mon, Mar 12, 2018 at 07:13:52AM +0000, Nir Soffer wrote:
> > On Fri, Mar 9, 2018 at 4:25 PM Richard W.M. Jones <rjones@redhat.com>
> wrote:
> >
> > > It has to be said it would be really convenient to have a 'zero'
> > > and/or 'trim' method of some
2016 Jan 18
3
[cfe-dev] RFC: Enforcing pointer type alignment in Clang
Hi John,
On 15 Jan 2016, at 08:14, John McCall via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> The question at hand is whether we should require the user to write this:
> misaligned_A_B *p = &a.b;
> instead of, say:
> A::B *p = &a.b;
> int x = *(misaligned_int*) &p->n;
> because we want to reserve the right to invoke undefined behavior and