Hi,

  The patch punishes reload of alternative pair of "d, Z" for movsi_internal1. 
The reload occurs if 'Z' doesn't match and generates an additional insn. So the memory 
reload should be punished.

  Bootstrapped and tested on powerpc64le-linux with no regressions. Is this 
okay for trunk? Any recommendations? Thanks a lot.


ChangeLog

2021-09-29 Haochen Gui <guih...@linux.ibm.com>

gcc/
        * gcc/config/rs6000/rs6000.md (movsi_internal1): disparages
        slightly the alternative 'Z' of "lfiwzx" when reload is needed.

patch.diff

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 6bec2bddbde..c961f2df4a7 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -7341,7 +7341,7 @@ (define_insn "*movsi_internal1"
           r,          *h,         *h")
        (match_operand:SI 1 "input_operand"
          "r,          U,
-          m,          Z,          Z,
+          m,          ^Z,         Z,
           r,          d,          v,
           I,          L,          eI,         n,
           wa,         O,          wM,         wB,

Reply via email to