[flang-commits] [flang] [flang] Fix fir.call setCalleeFromCallable (PR #187124)

via flang-commits flang-commits at lists.llvm.org
Wed Mar 18 08:09:43 PDT 2026


jeanPerier wrote:

> > The falling through is an implementation choice that you can only switch callee with a callee of the same mode (rational is simplicity).
> 
> The bug I ran into was for direct-to-direct where it calls setAttr and then falls through and calls setOperand.
> 

I am reading code and comments too fast today... falling back was probably the intention, not falling through. That part of the fix makes total sense :)

>  How would you prefer these be handled instead?

I would tend to not allow it until a pass is doing this and we can test it extensively in FIR to FIR with non common cases like the ones with argument attributes. But since you have started and added unit tests, I am also fine if you add some tests with argument attributes (like sret, noalias, ...) and check they are moved accordingly. I agree it is likely the right place to do it when we need it.

https://github.com/llvm/llvm-project/pull/187124


More information about the flang-commits mailing list