[PATCH] D98791: [PowerPC][NFC] Do not enter prefix selection if it cannot do better.

Stefan Pintilie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 22 07:18:30 PDT 2021


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb8f3c6d0110f: [PowerPC][NFC] Do not enter prefix selection if it cannot do better. (authored by stefanp).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98791/new/

https://reviews.llvm.org/D98791

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


Index: llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
===================================================================
--- llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
+++ llvm/lib/Target/PowerPC/PPCISelDAGToDAG.cpp
@@ -1167,7 +1167,10 @@
   const PPCSubtarget &Subtarget =
       CurDAG->getMachineFunction().getSubtarget<PPCSubtarget>();
 
-  if (Subtarget.hasPrefixInstrs()) {
+  // If we have prefixed instructions and there is a chance we can
+  // materialize the constant with fewer prefixed instructions than
+  // non-prefixed, try that.
+  if (Subtarget.hasPrefixInstrs() && InstCntDirect != 1) {
     unsigned InstCntDirectP = 0;
     SDNode *ResultP = selectI64ImmDirectPrefix(CurDAG, dl, Imm, InstCntDirectP);
     // Use the prefix case in either of two cases:


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D98791.332279.patch
Type: text/x-patch
Size: 774 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210322/71dc34d0/attachment.bin>


More information about the llvm-commits mailing list