Skip to content

MAINT: Mark npy_memchr with no_sanitize("alignment") on clang#21475

Merged
charris merged 1 commit intonumpy:maintenance/1.22.xfrom
charris:backport-21467
May 9, 2022
Merged

MAINT: Mark npy_memchr with no_sanitize("alignment") on clang#21475
charris merged 1 commit intonumpy:maintenance/1.22.xfrom
charris:backport-21467

Conversation

@charris
Copy link
Copy Markdown
Member

@charris charris commented May 9, 2022

Backport of #21467.

Clangs sanitizer reports unaligned access here, which is correct
but intentional. It may well be that the code would be better of
trying to avoid this unaligned access (and rather vectorizing harder).

But, this is a bit of a tricky choice, since we have to optimize for
different use-cases (in particular very short scans may be interesting).

So changing this would best be done together with some more careful
benchmarks.

See also gh-21117, which introduced manual loop unrolling to avoid the
unaligned access.

Closes gh-21116

Clangs sanitizer reports unaligned access here, which is correct
but intentional.  It may well be that the code would be better of
trying to avoid this unaligned access (and rather vectorizing harder).

But, this is a bit of a tricky choice, since we have to optimize for
different use-cases (in particular very short scans may be interesting).

So changing this would best be done together with some more careful
benchmarks.

See also numpygh-21117, which introduced manual loop unrolling to avoid the
unaligned access.

Closes numpygh-21116
@charris charris added 03 - Maintenance 08 - Backport Used to tag backport PRs labels May 9, 2022
@charris charris added this to the 1.22.4 release milestone May 9, 2022
@charris charris merged commit cac0887 into numpy:maintenance/1.22.x May 9, 2022
@charris charris deleted the backport-21467 branch May 9, 2022 03:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

03 - Maintenance 08 - Backport Used to tag backport PRs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants