Opened 7 months ago

Last modified 7 months ago

#16333 new task

Implement Loop-invariant code motion / Hoisting for Cmm

Reported by: AndreasK Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.6.3
Keywords: CodeGen Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: #12808 Differential Rev(s):
Wiki Page:

Description

Currently we don't but we should.

An example from nofib:

This is the innermost loop of fannkuch-redux.

       ca12:
           _s9D0::I64 = %MO_UU_Conv_W8_W64(I8[_s9zN::I64]);
           if (_s9D0::I64 != 0) goto ca1f; else goto ca1i;
       ca1f:
           I64[Sp - 16] = ca1d;
           R3 = _s9zN::I64 + _s9D0::I64;
           R2 = _s9zN::I64;
           I64[Sp - 8] = _s9CV::I64;
           I64[Sp] = _s9Cd::I64;
           I64[Sp + 40] = _s9Cc::I64;
           I64[Sp + 48] = _s9Cb::I64;
           I64[Sp + 56] = _s9zN::I64;
           Sp = Sp - 16;
           call $wflopp_r9x0_info(R3,
                                  R2) returns to ca1d, args: 8, res: 8, upd: 8;
       ca1d:
           Sp = Sp + 16;
           _s9CV::I64 = I64[Sp - 8] + 1;
           _s9Cd::I64 = I64[Sp + 0]; 16
           _s9z5::I64 = I64[Sp + 8]; //24
           _s9zv::I64 = I64[Sp + 16]; 32
           _s9zx::I64 = I64[Sp + 24]; 40
           _s9zz::I64 = I64[Sp + 32]; 48
           _s9Cc::I64 = I64[Sp + 40]; 56
           _s9Cb::I64 = I64[Sp + 48]; 64
           _s9zN::I64 = I64[Sp + 56]; 72

           goto ca12;

We should try to move the loads NOT used in the loop out of the loop at least.

Change History (1)

comment:1 Changed 7 months ago by simonpj

Keywords: CodeGen added
Note: See TracTickets for help on using tickets.