If you look at this snippet: llvm-project/mlir/lib/Conversion/FuncToLLVM/FuncToLLVM.cpp at 25e81394ce1cec0f7e6e46fb20d50a1ac1ff0083 · llvm/llvm-project · GitHub
The llvm.linkage key is used in the func dialect, retrieved and then the value is used to set the linkage when creating the LLVM function.
In the func dialect, the llvm.linkage is a discardable attribute, while in the LLVM dialect it is an inherent attribute, hence the difference in the key.