[llvm] [PowerPC] Correct toc_entry pattern in ADDIStocHA (PR #93905)

Kai Luo via llvm-commits llvm-commits at lists.llvm.org
Thu May 30 17:36:45 PDT 2024


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

`TOC_ENTRY` node is created with `{GA, Reg}` operands, the pattern in `ADDIStocHA` is inconsistent.

>From c87d3a0a7aaea9871b31058890aebaedc789fb74 Mon Sep 17 00:00:00 2001
From: Kai Luo <lkail at cn.ibm.com>
Date: Fri, 31 May 2024 08:20:57 +0800
Subject: [PATCH] Correct operands

---
 llvm/lib/Target/PowerPC/PPCInstrInfo.td | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.td b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
index e3d6d2f094f2e..8697a98d7accb 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrInfo.td
+++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.td
@@ -3345,7 +3345,7 @@ def LWZtocL : PPCEmitTimePseudo<(outs gprc:$rD), (ins tocentry32:$disp, gprc_nor
 def ADDIStocHA : PPCEmitTimePseudo<(outs gprc:$rD), (ins gprc_nor0:$reg, tocentry32:$disp),
                        "#ADDIStocHA",
                        [(set i32:$rD,
-                         (PPCtoc_entry i32:$reg, tglobaladdr:$disp))]>;
+                         (PPCtoc_entry tglobaladdr:$disp, i32:$reg))]>;
 // TOC Data Transform on AIX
 def ADDItoc : PPCEmitTimePseudo<(outs gprc:$rD), (ins tocentry32:$disp, gprc:$reg),
                    "#ADDItoc",



More information about the llvm-commits mailing list