[llvm] [RISCV] Change RISCVABI::computeTargetABI() to return Expected<ABI> (PR #213410)

Alexander Richardson via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 31 22:57:09 PDT 2026


================
@@ -117,7 +118,15 @@ RISCVSubtarget::initializeSubtargetDependencies(const Triple &TT, StringRef CPU,
   HasStdExtC = hasFeature(RISCV::FeatureStdExtC);
   HasStdExtZce = hasFeature(RISCV::FeatureStdExtZce);
 
-  TargetABI = RISCVABI::computeTargetABI(*this, ABIName);
+  // Can't be fatal: per-function subtargets mean this one may just be the
----------------
arichardson wrote:

I originally made this a hard error but it caused various tests to fail.

That said maybe an error is actually better? I'm not sure how likely it is that code for an ABI that doesn't match the feature flags will actually work in any way with mismatched per-function target flags. So maybe this should actually be an error or we need some way to define the ABI per function?

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


More information about the llvm-commits mailing list