Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MergeICmps does not work for non-eq comparisons #59740

Open
Kmeakin opened this issue Dec 29, 2022 · 4 comments
Open

MergeICmps does not work for non-eq comparisons #59740

Kmeakin opened this issue Dec 29, 2022 · 4 comments

Comments

@Kmeakin
Copy link
Contributor

Kmeakin commented Dec 29, 2022

Given a struct like

struct S {
    uint8_t a;
    uint8_t b;
    uint8_t c;
    uint8_t d;
    std::strong_ordering operator<=>(const S&) const = default;
};

MergeICmps is able to optimise the operator== implementation to a single uint32_t load and compare, but is not able to do the same for the other comparison operators

https://godbolt.org/z/Pnqa1cq5q

@vfdff
Copy link
Contributor

vfdff commented Jan 7, 2023

candidate MR: https://reviews.llvm.org/D141188

@vfdff vfdff closed this as completed in 3ac2b3a Jan 12, 2023
@vfdff
Copy link
Contributor

vfdff commented Jan 12, 2023

This issue should remain open, because this only handles the ne case, not other predicates

@Kmeakin
Copy link
Contributor Author

Kmeakin commented Mar 11, 2023

Reopening: this patch does not fix the other cases (lt, gt, le, ge)

@Kmeakin
Copy link
Contributor Author

Kmeakin commented May 8, 2023

Reopening: this patch does not fix the other cases (lt, gt, le, ge)

@Kmeakin Kmeakin reopened this May 8, 2023
@vfdff vfdff closed this as completed in fb2c98a May 24, 2023
@vfdff vfdff reopened this May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants