[llvm] [LLVM][TableGen] Check name conflicts between target dep and independent intrinsics (PR #109826)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 25 03:17:03 PDT 2024
================
@@ -101,6 +102,28 @@ void CodeGenIntrinsicTable::CheckDuplicateIntrinsics() const {
PrintFatalNote(First.TheDef, "Previous definition here");
}
+// For target independent intrinsics, check that their second dotted component
+// does not match any target name.
+void CodeGenIntrinsicTable::CheckTargetIndependentIntrinsics() const {
+ SmallDenseSet<StringRef> TargetNames;
+ for (const auto &Target : ArrayRef(Targets).drop_front())
+ TargetNames.insert(Target.Name);
+
+ // Set of target independent intrinsics.
+ const auto &Set = Targets[0];
+ for (const auto &Int : ArrayRef(&Intrinsics[Set.Offset], Set.Count)) {
+ StringRef Name = Int.Name;
+ StringRef Prefix = Name.drop_front(5).split('.').first;
----------------
arsenm wrote:
Maybe use consume_front("llvm.")
https://github.com/llvm/llvm-project/pull/109826
More information about the llvm-commits
mailing list