Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3527 closed defect (fixed)

wrong blt, becasue inlining of functions fail for more then one output

Reported by: Vitalij Ruge Owned by: somebody
Priority: critical Milestone: 1.9.4
Component: Frontend Version:
Keywords: Cc: Willi Braun, Adrian Pop, Martin Sjölund

Description

package inlineTest
  model A
    function f2
      input Real x1;
      input Real x2;
      output Real y1;
      output Real y2;
    algorithm
      y1 := cos(x1 + x2);
      y2 := sin(x1);
      annotation(Inline = true);
    end f2;

    Real x, z, y;
  equation
    (x, z) = f2(x, y);
    z = sin(time * x);
  end A;

  model B
    Real x, z, y;
  equation
    x = cos(x + y);
    z = sin(x);
    z = sin(time * x);
  end B;
end inlineTest;

In model B I try to inline f2.
The result for A: x,y,z are part of a loop.
The result for B: x,z are part of a loop.

Change History (14)

comment:1 by Lennart Ochel, 9 years ago

What flags do I need to reproduce the wrong BLT?

comment:2 by Lennart Ochel, 9 years ago

Component: UnknownBackend

comment:3 by Vitalij Ruge, 9 years ago

Component: BackendUnknown

In Inline.mo

(crefs,{cr},stmts,repl) = getFunctionInputsOutputBody

we have the limit for the outputs {cr} only one element

in reply to:  1 comment:4 by Vitalij Ruge, 9 years ago

Replying to lochel:

What flags do I need to reproduce the wrong BLT?

see description

comment:5 by Vitalij Ruge, 9 years ago

Cc: Adrian Pop Martin Sjölund added

comment:6 by Vitalij Ruge, 9 years ago

would it be possible to fixe/extend the frondend modul Inline.inlineCall and forceInlineCall for this case?

comment:7 by Lennart Ochel, 9 years ago

Well, I cannot see a wrong BLT. It is just that the equation system is different due to inlining (by hand in the second case).
So is this just about the limitation of the inlining module? Or is the BLT really wrong?

comment:8 by Martin Sjölund, 9 years ago

f2 should give a warning: Inline=true was given, but the function has more than a single assignment statement to a single variable and cannot be inlined. Or someone needs to rewrite the module to handle this.

in reply to:  8 comment:9 by Vitalij Ruge, 9 years ago

Replying to sjoelund.se:

Or someone needs to rewrite the module to handle this.

done in 251

comment:10 by Vitalij Ruge, 9 years ago

Milestone: Future1.9.4
Resolution: fixed
Status: newclosed

comment:11 by Lennart Ochel, 9 years ago

Component: UnknownFrontend
Priority: criticalhigh

comment:12 by anonymous, 9 years ago

Priority: highcritical

comment:13 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:14 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.