Issue with optimization -funroll-loops

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello all,

I have an issue with optimization -funroll_loops in my custom backend.


> blueproc-blueice-none-gcc -O3  -dump-all -funroll-loops -S test3.c (This is the command)

Between files test3.c.254r.loop2_done and test3.c.255r.web, there are optimizations done that seems very dubious. - There is a parallel operation that sets 4 subregs of regsiter SI 131 in the '254 file, and in the '255 file, additional registers
  are introduced in a way:
  a. It is not necessary. Not possible to optimize anything like this.
  b. It breaks the functionality. It is not correct any more.

Q.
  - Why ?. On what basis is this decided ?.
  - Is it possible to turn the optimization off ?.

Best regards,

Henri.


+++++++++++++++++++ test3.c.c254r.loop2_done: +++++++++++++++++++++++++++

(insn 24 23 25 2 (parallel [
            (set (subreg:QI (reg:SI 131) 0)
                (if_then_else:QI (lt (reg:SI 78 [ d.7_7 ])
                        (const_int 1 [0x1]))
                    (const_int 1 [0x1])
                    (const_int 0 [0])))
            (set (subreg:QI (reg:SI 131) 1)
                (if_then_else:QI (gt (reg:SI 78 [ d.7_7 ])
                        (const_int 1 [0x1]))
                    (const_int 1 [0x1])
                    (const_int 0 [0])))
            (set (subreg:QI (reg:SI 131) 2)
                (if_then_else:QI (eq (reg:SI 78 [ d.7_7 ])
                        (const_int 1 [0x1]))
                    (const_int 1 [0x1])
                    (const_int 0 [0])))
            (set (subreg:QI (reg:SI 131) 3)
                (const_int 1 [0x1]))
        ]) 32 {comparison_internal_signed}
     (expr_list:REG_UNUSED (reg:SI 131)
        (expr_list:REG_UNUSED (reg:SI 131)
            (expr_list:REG_UNUSED (reg:SI 131)
                (nil)))))

(jump_insn 25 24 26 2 (set (pc)
        (if_then_else (eq (subreg:QI (reg:SI 131) 2)
                (const_int 1 [0x1]))
            (label_ref 100)
            (pc))) 34 {branch_internal_novec}
(expr_list:REG_DEAD (reg:SI 131)
        (int_list:REG_BR_PROB 858993468 (nil)))

++++++++++++++++++++++++++++ test3.c.255r.web +++++++++++++++++++++++++++++++++++++

(insn 24 23 25 2 (parallel [
            (set (subreg:QI (reg:SI 131) 0)
                (if_then_else:QI (lt (reg:SI 78 [ d.7_7 ])
                        (const_int 1 [0x1]))
                    (const_int 1 [0x1])
                    (const_int 0 [0])))
            (set (subreg:QI (reg:SI 189) 1)
                (if_then_else:QI (gt (reg:SI 78 [ d.7_7 ])
                        (const_int 1 [0x1]))
                    (const_int 1 [0x1])
                    (const_int 0 [0])))
            (set (subreg:QI (reg:SI 190) 2)
                (if_then_else:QI (eq (reg:SI 78 [ d.7_7 ])
                        (const_int 1 [0x1]))
                    (const_int 1 [0x1])
                    (const_int 0 [0])))
            (set (subreg:QI (reg:SI 191) 3)
                (const_int 1 [0x1]))
        ]) 32 {comparison_internal_signed}
     (expr_list:REG_UNUSED (reg:SI 131)
        (expr_list:REG_UNUSED (reg:SI 131)
            (expr_list:REG_UNUSED (reg:SI 131)
                (nil)))))
(jump_insn 25 24 26 2 (set (pc)
        (if_then_else (eq (subreg:QI (reg:SI 191) 2)
                (const_int 1 [0x1]))
            (label_ref 100)
            (pc))) 34 {branch_internal_novec}
     (expr_list:REG_DEAD (reg:SI 131)
        (int_list:REG_BR_PROB 858993468 (nil)))




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux