This is an archive of the discontinued LLVM Phabricator instance.

[X86] Assume alignment of movdir64b dst argument
ClosedPublic

Authored by GBuella on May 10 2018, 2:19 AM.

Diff Detail

Repository
rL LLVM

Event Timeline

GBuella created this revision.May 10 2018, 2:19 AM

What effect does this have?

GBuella added a comment.EditedMay 10 2018, 12:07 PM

What effect does this have?

Nothing important really, I just guessed it doesn't cost us much.
One contrived example I could come up with in 2 minutes:

#include <x86intrin.h>

void x(char *restrict a __attribute__((align_value(64))), char *restrict b, const char *c)
{
        _movdir64b(b, c);

        for (int i = 0; i < 32; ++i)
                a[i] = b[i];
}

The silly memcpy loop above becomes 2 movaps instructions, instead of two movups instructions.

This revision is now accepted and ready to land.May 10 2018, 10:50 PM
This revision was automatically updated to reflect the committed changes.