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

Ryan Cowan via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 27 01:48:20 PST 2026


================
@@ -0,0 +1,23 @@
+; NOTE: Do not autogenerate
+; RUN: llc -mtriple=aarch64-linux-gnu -O2 -verify-machineinstrs -debug %s -o - 2>&1 | FileCheck %s --check-prefix=GISEL
+; REQUIRES: asserts
+
+; Check both an optnone function and a non-optnone function to ensure that only
+; the optnone functions is routed through GlobalISel
+
+define i32 @optnone_fn(i32 %a) #0 {
+entry:
+  %add = add nsw i32 %a, 1
+  ret i32 %add
+}
+
+define i32 @normal_fn(i32 %a) {
+entry:
+  %mul = mul nsw i32 %a, 2
+  ret i32 %mul
+}
+
+; GISEL: Skipping pass 'AArch64PostLegalizerCombiner' on function optnone_fn
+; GISEL: Creating new node:
----------------
HolyMolyCowMan wrote:

I'll add a comment to explain this. The second check is for the normal_fn, 'Creating new node:' is an SDAG specific debug message.

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


More information about the llvm-commits mailing list