[llvm] delete MF.verify from PPCMIPeephole pass (PR #108075)

zhijian lin via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 16 06:36:53 PDT 2024


https://github.com/diggerlin updated https://github.com/llvm/llvm-project/pull/108075

>From 969ca98babe985426b376c1f3bf5e8b21f80c0dc Mon Sep 17 00:00:00 2001
From: zhijian <zhijian at ca.ibm.com>
Date: Tue, 10 Sep 2024 15:44:01 -0400
Subject: [PATCH 1/2] delete  MF.verify from PPCMIPeephole pass

---
 llvm/lib/Target/PowerPC/PPCMIPeephole.cpp | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp b/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
index b8abee76cdfa80..b00984bac7ec75 100644
--- a/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
+++ b/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
@@ -177,11 +177,6 @@ struct PPCMIPeephole : public MachineFunctionPass {
     if (skipFunction(MF.getFunction()))
       return false;
     bool Changed = simplifyCode();
-#ifndef NDEBUG
-    if (Changed)
-      MF.verify(this, "Error in PowerPC MI Peephole optimization, compile with "
-                      "-mllvm -disable-ppc-peephole");
-#endif
     return Changed;
   }
 };

>From bebe28c393646ae45750d5a65648c8e08e772250 Mon Sep 17 00:00:00 2001
From: zhijian <zhijian at ca.ibm.com>
Date: Mon, 16 Sep 2024 09:36:31 -0400
Subject: [PATCH 2/2] change macro NDEBUG to EXPENSIVE_CHECKS

---
 llvm/lib/Target/PowerPC/PPCMIPeephole.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp b/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
index b00984bac7ec75..ca59bcba6478bd 100644
--- a/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
+++ b/llvm/lib/Target/PowerPC/PPCMIPeephole.cpp
@@ -177,6 +177,11 @@ struct PPCMIPeephole : public MachineFunctionPass {
     if (skipFunction(MF.getFunction()))
       return false;
     bool Changed = simplifyCode();
+#ifdef EXPENSIVE_CHECKS
+    if (Changed)
+      MF.verify(this, "Error in PowerPC MI Peephole optimization, compile with "
+                      "-mllvm -disable-ppc-peephole");
+#endif
     return Changed;
   }
 };



More information about the llvm-commits mailing list