Skip to content

[RISC-V] remove I ext when E ext has been enabled #92070

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

Merged
merged 1 commit into from
May 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions llvm/lib/TargetParser/RISCVISAInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,13 +758,19 @@ RISCVISAInfo::parseArchString(StringRef Arch, bool EnableExperimentalExtension,
}

Error RISCVISAInfo::checkDependency() {
bool HasE = Exts.count("e") != 0;
bool HasI = Exts.count("i") != 0;
bool HasC = Exts.count("c") != 0;
bool HasF = Exts.count("f") != 0;
bool HasZfinx = Exts.count("zfinx") != 0;
bool HasVector = Exts.count("zve32x") != 0;
bool HasZvl = MinVLen != 0;
bool HasZcmt = Exts.count("zcmt") != 0;

if (HasI && HasE)
return createStringError(errc::invalid_argument,
"'I' and 'E' extensions are incompatible");

if (HasF && HasZfinx)
return createStringError(errc::invalid_argument,
"'f' and 'zfinx' extensions are incompatible");
Expand Down Expand Up @@ -852,6 +858,9 @@ void RISCVISAInfo::updateImplication() {
addExtension("i", Version.value());
}

if (HasE && HasI)
Exts.erase("i");

assert(llvm::is_sorted(ImpliedExts) && "Table not sorted by Name");

// This loop may execute over 1 iteration since implication can be layered
Expand Down
Loading