Page MenuHomePhabricator

[IR] Short-circuit comparison with itself for Attributes

Authored by danilaml on Jun 22 2020, 6:26 AM.

Diff Detail

Event Timeline

danilaml created this revision.Jun 22 2020, 6:26 AM
Herald added a project: Restricted Project. · View Herald Transcript
danilaml marked an inline comment as done.Jun 22 2020, 6:31 AM
danilaml added inline comments.

This avoids potential assert here (which can be triggered when glibc tests irreflexivity with expensive checks enabled).

danilaml updated this revision to Diff 272428.Jun 22 2020, 7:32 AM

Can this be covered in LLVM's regression tests?

danilaml updated this revision to Diff 272677.Jun 23 2020, 4:43 AM

@dblaikie It was actually failing on some of the lit tests when compiler was compiled with EXPENSIVE_CHECKS enabled (kind of how I discovered it), but after this recent refactor which removed a sort step:
I don't know if the codepath with ::sort (which has those checks) can be hit from llvm IR. Instead, I've added an explicit check to AttributesTest.cpp that currently asserts.

This revision is now accepted and ready to land.Jul 2 2020, 1:15 PM
This revision was automatically updated to reflect the committed changes.