[llvm] Use Module level target-abi to assign target features for codegenerated functions. (PR #100833)

Sam Elliott via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 18 05:26:38 PST 2024


================
@@ -387,6 +388,25 @@ Function *Function::Create(FunctionType *Ty, LinkageTypes Linkage,
   return Create(Ty, Linkage, M.getDataLayout().getProgramAddressSpace(), N, &M);
 }
 
+StringRef Function::getDefaultTargetFeatures(const StringRef TargetABI) {
+  Triple T(getParent()->getTargetTriple());
+  StringRef attr = "";
+  if (T.isRISCV64()) {
+    if (TargetABI.contains("lp64d"))
----------------
lenary wrote:

I don't like this contains for the risc-v abi checks, it should just be equality (maybe case-insensitive) - I'm not sure we have any special prefixes or suffixes that can be used, or will be used by llvm.

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


More information about the llvm-commits mailing list