[PATCH] D127949: [PowerPC] Don't lower to CALL to CALL_NOP on LV2 (PS3)

ProtoByter via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 16 03:00:33 PDT 2022


ProtoByter created this revision.
ProtoByter added a reviewer: PowerPC.
ProtoByter added a project: PowerPC.
Herald added subscribers: shchenz, kbarton, hiraditya, nemanjai.
Herald added a project: All.
ProtoByter requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This change stops LLVM from lowering  `PPCISD::CALL` to `PPCISD::CALL_NOP` on LV2 since it stops it from being able to build LV2 code
I've tested this with RPCS3 using a sample from PSL1GHT and I can confirm that it runs for me
This fixes issue #55456 <https://github.com/llvm/llvm-project/issues/55456>


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127949

Files:
  llvm/lib/Target/PowerPC/PPCISelLowering.cpp


Index: llvm/lib/Target/PowerPC/PPCISelLowering.cpp
===================================================================
--- llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -5248,8 +5248,9 @@
     // TOC pointer at an ABI designated offset in the linkage area and the
     // linker will rewrite the nop to be a load of the TOC pointer from the
     // linkage area into gpr2.
-    RetOpc = callsShareTOCBase(&Caller, Callee, TM) ? PPCISD::CALL
-                                                    : PPCISD::CALL_NOP;
+    RetOpc = callsShareTOCBase(&Caller, Callee, TM)
+        && Subtarget.getTargetTriple().getOS() != Triple::Lv2   ? PPCISD::CALL
+                                                                : PPCISD::CALL_NOP;
   else
     RetOpc = PPCISD::CALL;
   if (IsStrictFPCall) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127949.437489.patch
Type: text/x-patch
Size: 842 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220616/68b32897/attachment.bin>


More information about the llvm-commits mailing list