[RS6000] Don't allow combine to form doloop pattern
authorAlan Modra <amodra@gmail.com>
Mon, 11 Jul 2016 10:28:48 +0000 (19:58 +0930)
committerAlan Modra <amodra@gcc.gnu.org>
Mon, 11 Jul 2016 10:28:48 +0000 (19:58 +0930)
* config/rs6000/rs6000.md (UNSPEC_DOLOOP): New unspec.
(ctr<mode>): Add unspec.
(ctr<mode>_internal*): Likewise.

From-SVN: r238207

gcc/ChangeLog
gcc/config/rs6000/rs6000.md

index 7dd0db561c208442c942d13899e9a5477dca34de..0453adaf9ac6605c3f5991c88827b102602ae32b 100644 (file)
@@ -1,3 +1,9 @@
+2016-07-11  Alan Modra  <amodra@gmail.com>
+
+       * config/rs6000/rs6000.md (UNSPEC_DOLOOP): New unspec.
+       (ctr<mode>): Add unspec.
+       (ctr<mode>_internal*): Likewise.
+
 2016-07-08  James Bowman  <james.bowman@ftdichip.com>
 
        * config/ft32/ft32.c (ft32_elf_encode_section_info): New function.
index 7d9c6600f2aa7fa8f0b0c7a79a5a817ef09a0fae..5d212dd81808925c397e654cb8b6236c89a31b36 100644 (file)
    UNSPEC_IEEE128_MOVE
    UNSPEC_IEEE128_CONVERT
    UNSPEC_SIGNBIT
+   UNSPEC_DOLOOP
   ])
 
 ;;
              (set (match_dup 0)
                   (plus:P (match_dup 0)
                            (const_int -1)))
+             (unspec [(const_int 0)] UNSPEC_DOLOOP)
              (clobber (match_scratch:CC 2 ""))
              (clobber (match_scratch:P 3 ""))])]
   ""
 ;; JUMP_INSNs.
 ;; For the length attribute to be calculated correctly, the
 ;; label MUST be operand 0.
+;; The UNSPEC is present to prevent combine creating this pattern.
 
 (define_insn "*ctr<mode>_internal1"
   [(set (pc)
    (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*wi*c*l")
        (plus:P (match_dup 1)
                 (const_int -1)))
+   (unspec [(const_int 0)] UNSPEC_DOLOOP)
    (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
    (clobber (match_scratch:P 4 "=X,X,&r,r"))]
   ""
    (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*wi*c*l")
        (plus:P (match_dup 1)
                 (const_int -1)))
+   (unspec [(const_int 0)] UNSPEC_DOLOOP)
    (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
    (clobber (match_scratch:P 4 "=X,X,&r,r"))]
   ""
    (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*wi*c*l")
        (plus:P (match_dup 1)
                 (const_int -1)))
+   (unspec [(const_int 0)] UNSPEC_DOLOOP)
    (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
    (clobber (match_scratch:P 4 "=X,X,&r,r"))]
   ""
    (set (match_operand:P 2 "nonimmediate_operand" "=1,*r,m,*d*wi*c*l")
        (plus:P (match_dup 1)
                 (const_int -1)))
+   (unspec [(const_int 0)] UNSPEC_DOLOOP)
    (clobber (match_scratch:CC 3 "=X,&x,&x,&x"))
    (clobber (match_scratch:P 4 "=X,X,&r,r"))]
   ""
                      (match_operand 6 "" "")))
    (set (match_operand:P 0 "int_reg_operand" "")
        (plus:P (match_dup 1) (const_int -1)))
+   (unspec [(const_int 0)] UNSPEC_DOLOOP)
    (clobber (match_scratch:CC 3 ""))
    (clobber (match_scratch:P 4 ""))]
   "reload_completed"
                      (match_operand 6 "" "")))
    (set (match_operand:P 0 "nonimmediate_operand" "")
        (plus:P (match_dup 1) (const_int -1)))
+   (unspec [(const_int 0)] UNSPEC_DOLOOP)
    (clobber (match_scratch:CC 3 ""))
    (clobber (match_scratch:P 4 ""))]
   "reload_completed && ! gpc_reg_operand (operands[0], SImode)"