[llvm] fcc82cf - [LoongArch] Precommit test case to show bug in LoongArchISelDagToDag

Weining Lu via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 7 00:35:13 PDT 2025


Author: Weining Lu
Date: 2025-06-07T15:10:26+08:00
New Revision: fcc82cfa9394b2bd4380acdcf0e2854caee5a47a

URL: https://github.com/llvm/llvm-project/commit/fcc82cfa9394b2bd4380acdcf0e2854caee5a47a
DIFF: https://github.com/llvm/llvm-project/commit/fcc82cfa9394b2bd4380acdcf0e2854caee5a47a.diff

LOG: [LoongArch] Precommit test case to show bug in LoongArchISelDagToDag

The optimization level should not be restored into O2.

Added: 
    llvm/test/CodeGen/LoongArch/isel-optnone.ll

Modified: 
    

Removed: 
    


################################################################################
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 }


        


More information about the llvm-commits mailing list