https://github.com/llvmbot created 
https://github.com/llvm/llvm-project/pull/144296

Backport fcc82cf

Requested by: @leecheechen

>From 82272742df0b664c54e07b1f45634e07933dbfd4 Mon Sep 17 00:00:00 2001
From: Weining Lu <luwein...@loongson.cn>
Date: Sat, 7 Jun 2025 15:10:24 +0800
Subject: [PATCH] [LoongArch] Precommit test case to show bug in
 LoongArchISelDagToDag

The optimization level should not be restored into O2.

(cherry picked from commit fcc82cfa9394b2bd4380acdcf0e2854caee5a47a)
---
 llvm/test/CodeGen/LoongArch/isel-optnone.ll | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 llvm/test/CodeGen/LoongArch/isel-optnone.ll

diff --git a/llvm/test/CodeGen/LoongArch/isel-optnone.ll 
b/llvm/test/CodeGen/LoongArch/isel-optnone.ll
new file mode 100644
index 0000000000000..d44f1405d0c18
--- /dev/null
+++ b/llvm/test/CodeGen/LoongArch/isel-optnone.ll
@@ -0,0 +1,13 @@
+; REQUIRES: asserts
+; RUN: llc %s -O0 -mtriple=loongarch64 -o /dev/null -debug-only=isel 2>&1 | 
FileCheck %s
+
+define void @fooOptnone() #0 {
+; CHECK: Changing optimization level for Function fooOptnone
+; CHECK: Before: -O2 ; After: -O0
+
+; CHECK: Restoring optimization level for Function fooOptnone
+; CHECK: Before: -O0 ; After: -O2
+  ret void
+}
+
+attributes #0 = { nounwind optnone noinline }

_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to