[llvm] [AArch64] Use GISel for optnone functions (PR #174746)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 8 04:32:31 PST 2026


================
@@ -4140,6 +4140,21 @@ bool IRTranslator::runOnMachineFunction(MachineFunction &CurMF) {
   // Set the CSEConfig and run the analysis.
   GISelCSEInfo *CSEInfo = nullptr;
   TPC = &getAnalysis<TargetPassConfig>();
+  if (!TPC->useGlobalISelFor(F)) {
+    LLVM_DEBUG(
+        dbgs()
+        << "Skipping GISel as useGlobalISelFor this function is false.\n");
+
+    // Create a block if this would have been the first block
+    // to avoid MachineDominatorTree hitting a sentinel assertion
----------------
arsenm wrote:

I've long wanted empty machine functions to be a verifier error, but it's tricky 

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


More information about the llvm-commits mailing list