https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125373

--- Comment #3 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(insn 40 39 41 7 (parallel [
            (set (reg:DI 2 cx [orig:129 _47 ] [129])
                (mult:DI (reg/f:DI 7 sp)
                    (const_int 5 [0x5])))
            (clobber (reg:CC 17 flags))
        ]) 623 {*muldi3_1}
     (expr_list:REG_UNUSED (reg:CC 17 flags)
        (nil)))

into:
(insn 140 39 41 7 (set (reg:DI 2 cx [orig:129 _47 ] [129])
        (plus:DI (mult:DI (reg/f:DI 7 sp)
                (const_int 4 [0x4]))
            (reg/f:DI 7 sp))) -1
     (nil))

via:
;; Convert imul by three, five and nine into lea
(define_peephole2
  [(parallel
    [(set (match_operand:SWI48 0 "register_operand")
          (mult:SWI48 (match_operand:SWI48 1 "register_operand")
                      (match_operand:SWI48 2 "const359_operand")))
     (clobber (reg:CC FLAGS_REG))])]
  "!TARGET_PARTIAL_REG_STALL
   || <MODE>mode == SImode
   || optimize_function_for_size_p (cfun)"
  [(set (match_dup 0)
        (plus:SWI48 (mult:SWI48 (match_dup 1) (match_dup 2))
                    (match_dup 1)))]
  "operands[2] = GEN_INT (INTVAL (operands[2]) - 1);")

Reply via email to