Skip to content

Conversation

@mikolaj-pirog
Copy link
Member

The INTEL_CLEARWATERFOREST belonged to ProcessorTypes enum, but it was assigned to Subtype value, leading to cpu_specific/cpu_dispatch not recognizing CWF. The type for Subtype and Type are changed to respective enums to guard against these sort of errors in the future

@github-actions
Copy link

github-actions bot commented Oct 22, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@mikolaj-pirog
Copy link
Member Author

Sorry for accidental ping everyone, I've made a mistake during rebase

@mikolaj-pirog
Copy link
Member Author

My previous approach, to move CWF to Subtypes, is wrong -- these tables have to be in-sync with respective tables in gcc (gcc/common/config/i386/i386-cpuinfo.h). Otherwise, this won't work due to indexes being not synced. As such, I left the INTEL_CLEARWATERFOREST where it was, and changed it to be assigned to Type instead of Subtype

Copy link
Contributor

@e-kud e-kud left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@mikolaj-pirog mikolaj-pirog merged commit c13ac9c into llvm:main Oct 23, 2025
10 checks passed
};

enum ProcessorVendors {
enum ProcessorVendors : unsigned int {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this ISO-compliant C? In C17 standard 6.7.2.2 enum-specifier has no enum-base which I am afraid that is only a C++11 feature.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok. enum-type-specifier is a C23 feature and only supported in gcc-13+. Is this : unsigned int important here and can we get rid of it in favor of compatibility with older compilers?

mikolaj-pirog added a commit that referenced this pull request Oct 26, 2025
…tion (#165048)

Typed enums are c23 features and are too new to be used. This PR
restores the types in the `__processor_model` struct back to `unsigned
int`, removes typed enums, and uses the enum in the function as a
variable that's later assigned to a struct in order to prevent errors
fixed initially here: #164713

See #165034 for more background
varun-r-mallya pushed a commit to varun-r-mallya/llvm-project that referenced this pull request Oct 27, 2025
…tion (llvm#165048)

Typed enums are c23 features and are too new to be used. This PR
restores the types in the `__processor_model` struct back to `unsigned
int`, removes typed enums, and uses the enum in the function as a
variable that's later assigned to a struct in order to prevent errors
fixed initially here: llvm#164713

See llvm#165034 for more background
dvbuka pushed a commit to dvbuka/llvm-project that referenced this pull request Oct 27, 2025
The `INTEL_CLEARWATERFOREST` belongs to `ProcessorTypes` enum, but it
was assigned to `Subtype` value, leading to cpu_specific/cpu_dispatch
not recognizing CWF. The type for `Subtype` and `Type` are changed to
respective enums to guard against these sort of errors in the future
dvbuka pushed a commit to dvbuka/llvm-project that referenced this pull request Oct 27, 2025
…tion (llvm#165048)

Typed enums are c23 features and are too new to be used. This PR
restores the types in the `__processor_model` struct back to `unsigned
int`, removes typed enums, and uses the enum in the function as a
variable that's later assigned to a struct in order to prevent errors
fixed initially here: llvm#164713

See llvm#165034 for more background
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants