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

[Clang][TableGen] Change NeonEmitter to use const Record * #110597

Merged
merged 1 commit into from
Oct 1, 2024
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions clang/utils/TableGen/NeonEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,8 +410,7 @@ class Intrinsic {
}

int ArgIdx, Kind, TypeArgIdx;
std::vector<Record *> ImmCheckList = R->getValueAsListOfDefs("ImmChecks");
for (const auto *I : ImmCheckList) {
for (const Record *I : R->getValueAsListOfDefs("ImmChecks")) {
unsigned EltSizeInBits = 0, VecSizeInBits = 0;

ArgIdx = I->getValueAsInt("ImmArgIdx");
Expand Down
12 changes: 5 additions & 7 deletions clang/utils/TableGen/SveEmitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1161,11 +1161,9 @@ void SVEEmitter::createIntrinsic(
uint64_t Merge = R->getValueAsInt("Merge");
StringRef MergeSuffix = R->getValueAsString("MergeSuffix");
uint64_t MemEltType = R->getValueAsInt("MemEltType");
std::vector<Record*> FlagsList = R->getValueAsListOfDefs("Flags");
std::vector<Record*> ImmCheckList = R->getValueAsListOfDefs("ImmChecks");

int64_t Flags = 0;
for (auto FlagRec : FlagsList)
for (const Record *FlagRec : R->getValueAsListOfConstDefs("Flags"))
Flags |= FlagRec->getValueAsInt("Value");

// Create a dummy TypeSpec for non-overloaded builtins.
Expand Down Expand Up @@ -1195,10 +1193,10 @@ void SVEEmitter::createIntrinsic(
for (auto TS : TypeSpecs) {
// Collate a list of range/option checks for the immediates.
SmallVector<ImmCheck, 2> ImmChecks;
for (auto *R : ImmCheckList) {
int64_t ArgIdx = R->getValueAsInt("ImmArgIdx");
int64_t EltSizeArgIdx = R->getValueAsInt("TypeContextArgIdx");
int64_t Kind = R->getValueAsDef("Kind")->getValueAsInt("Value");
for (const Record *ImmR : R->getValueAsListOfConstDefs("ImmChecks")) {
int64_t ArgIdx = ImmR->getValueAsInt("ImmArgIdx");
int64_t EltSizeArgIdx = ImmR->getValueAsInt("TypeContextArgIdx");
int64_t Kind = ImmR->getValueAsDef("Kind")->getValueAsInt("Value");
assert(ArgIdx >= 0 && Kind >= 0 &&
"ImmArgIdx and Kind must be nonnegative");

Expand Down
Loading