Skip to content

remove-nested-function inflates the source #284

@Endilll

Description

@Endilll

The following original source:

  constexpr auto itrdim(const syntax &c,id i){
    return with_op(
      [&](auto i) -> cstsym {
        if constexpr(i.tag() == optag::cst)
          return i;
        else if constexpr(i.tag() == any_of(optag::itr, optag::rfl))
          return itrdim(c, arg(c, i, 0_N));
        else{
          std::unreachable();
          return {};
        }
      },
      i);
  }

is being inflated like this:

void itrdim( void) {
       with_op(       [&](auto i) {
             auto __trans_tmp_1724 = arg(itrdim_c, i, __trans_tmp_1);
             auto __trans_tmp_1723 = __trans_tmp_1724;
             auto __trans_tmp_1722 = __trans_tmp_1723;
             auto __trans_tmp_1721 = __trans_tmp_1722;
             // ...
             auto __trans_tmp_18 = __trans_tmp_19;
             __trans_tmp_18;
           }
    ,       itrdim_i)

C-Reduce log looks as follows:

===< pass_clang :: remove-nested-function >===
(-0.9 %, 8028 bytes)
timestamp 87 size 8028
(-1.4 %, 8066 bytes)
timestamp 87 size 8066
(-2.0 %, 8117 bytes)
timestamp 88 size 8117
(-2.7 %, 8168 bytes)
timestamp 88 size 8168
(-3.3 %, 8219 bytes)
timestamp 88 size 8219
(-4.0 %, 8270 bytes)
timestamp 89 size 8270
(-4.6 %, 8321 bytes)
timestamp 89 size 8321
(-5.2 %, 8372 bytes)
timestamp 90 size 8372
(-5.9 %, 8423 bytes)
timestamp 90 size 8423
(-6.5 %, 8474 bytes)
timestamp 90 size 8474
...
(-1152.8 %, 99662 bytes)
timestamp 933 size 99662
(-1153.5 %, 99717 bytes)
timestamp 933 size 99717

C-Reduce version and invocation are the same as in #283, except for added --remove-pass pass_clang copy-propagation to work around that issue.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions