[llvm] [AArch64] Fall back to SelectionDAG ISel if GISel is not feasible. (PR #196343)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 03:06:58 PDT 2026


================
@@ -613,7 +599,14 @@ bool AArch64CallLowering::fallBackToDAGISel(const MachineFunction &MF) const {
       Attrs.hasStreamingCompatibleInterface())
     return true;
 
-  return false;
+  // Enable GlobalISel when feasible and when:
+  // * Forced by option to enable gisel
+  // * The current opt-level is supported by EnableGlobalISelAtO
+  // * The function is an optnone function.
+  auto OptLevel = MF.getTarget().getOptLevel();
+  return !(getCGPassBuilderOption().EnableGlobalISelOption.value_or(false) ||
+           static_cast<unsigned>(OptLevel) <= TM.getEnableGlobalISelAtO() ||
+           F.hasOptNone());
----------------
sdesmalen-arm wrote:

Yes, same here, I wrote it like this on purpose because it's a bit easier to reason about.

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


More information about the llvm-commits mailing list