I’m not great at reading assembly, but in your example, it’s enough to turn on some non-zero level of optimization to achieve it: -O1 with ifort and -O2 with gfortran. Compiler experts will have better comments than mine, but I believe polymorphism only kicks in when you have a polymorphic variable (declared class(whatever), allocatable), while if your variable is statically typed (type(whatever_1)) the compiler knows exactly what functions have to be called, and can inline them