[llvm] [LLVM][TableGen] Add overloaded intrinsic name conflict checks (PR #109314)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 19 22:23:47 PDT 2024


================
@@ -94,6 +95,168 @@ void CodeGenIntrinsicTable::CheckDuplicateIntrinsics() const {
   PrintFatalNote(First.TheDef, "Previous definition here");
 }
 
+// Note: This is a modified version of `Intrinsic::lookupLLVMIntrinsicByName`
+// in IntrinsicInst.cpp file.
+template <typename T>
+int lookupLLVMIntrinsicByName(ArrayRef<const T *> NameTable, StringRef Name,
+                              function_ref<const char *(const T *)> ToString) {
+  using ToStringTy = function_ref<const char *(const T *)>;
+  assert(Name.starts_with("llvm.") && "Unexpected intrinsic prefix");
----------------
arsenm wrote:

This probably shouldn't be an assert 

https://github.com/llvm/llvm-project/pull/109314


More information about the llvm-commits mailing list