https://github.com/tex3d commented:

This is interesting.

I wonder though what it looks like in the AST when initializing something with 
the result of a function call that return an aggregate that must be split up 
across different boundaries?  Or what about expressions with side-effects?  How 
does it not duplicate sub-expressions while also not creating temporary 
variables to capture results?

Shouldn't there be an AST test so we can verify the way it transforms the code?

```hlsl
struct Foo {
    float f1;
    float f2;
};

Foo makeFoo() {
    Foo foo = {1, 2};
    return foo;
}

struct TwoFoo {
    Foo foo1, foo2;
};

TwoFoo testSplitFoo() {
    TwoFoo twoFoo = {0, makeFoo(), 3};
    return twoFoo;
}
```

https://github.com/llvm/llvm-project/pull/123141
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to