llvm-project
94c024ad - [flang][lowering] delay stack save/restor emission in elemental calls (#109142)

Commit
356 days ago
[flang][lowering] delay stack save/restor emission in elemental calls (#109142) stack save/restore emitted for character elemental function result allocation inside hlfir.elemental in lowering created memory bugs because result memory is actually still used after the stack restore when lowering the elemental into a loop where the result element is copied into the array result storage. Instead of adding special handling for stack save/restore in lowering, just avoid emitting those since the stack reclaim pass is able to emit them in the generated loop. Not having those stack save/restore will also help optimizations that want to elide the temporary allocation for the element result when that is possible.
Author
Parents
Loading