[llvm] [PowerPC] Let base implementation decide if MI is rematerizable by default (PR #75772)

Kai Luo via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 17 23:47:22 PST 2023


https://github.com/bzEq created https://github.com/llvm/llvm-project/pull/75772

If MI is not PPC specific instructions, let base implementation decide if MI is rematerizable.
This can fix failure in #75570 after #75271 .

>From 017f9e450465c873eccbb788143d68d5b8bf5edf Mon Sep 17 00:00:00 2001
From: Kai Luo <lkail at cn.ibm.com>
Date: Mon, 18 Dec 2023 07:43:50 +0000
Subject: [PATCH] Fallback to base impl

---
 llvm/lib/Target/PowerPC/PPCInstrInfo.cpp | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
index d0a6cced1b1974..4dfd0358a16fd4 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
@@ -1067,9 +1067,7 @@ bool PPCInstrInfo::isReallyTriviallyReMaterializable(
     const MachineInstr &MI) const {
   switch (MI.getOpcode()) {
   default:
-    // This function should only be called for opcodes with the ReMaterializable
-    // flag set.
-    llvm_unreachable("Unknown rematerializable operation!");
+    // Let base implementaion decide.
     break;
   case PPC::LI:
   case PPC::LI8:



More information about the llvm-commits mailing list