First issue is that the clean-ups were generated after the yield_element
operation that must be the terminator. Second issue is that codegen for
elemenal operation was not working properly with nested elemental ops.
Details
- Reviewers
jeanPerier - Commits
- rGebae4cc7cbe2: [flang][hlfir] Fixed array constructor lowering.
Diff Detail
Event Timeline
Thanks a lot for figuring out the issue here and fixing this!
flang/lib/Optimizer/Builder/HLFIRTools.cpp | ||
---|---|---|
749 | I agree. | |
flang/lib/Optimizer/HLFIR/Transforms/BufferizeHLFIR.cpp | ||
594 | It could also simply be unconditionally legal (target.addLegalOp<hlfir::YieldElementOp>, and removed from the target.addIllegalOp list) since it has no pattern anyway as you point out, and that the verifier would still complain if one remains after the pass since it has the HasParent<ElementalOp> trait and hlfir::ElementalOp is illegal here. |
I agree.
This would not simplify the bufferize pass situation with YieldOp, right ? As I understand it occurs when a YieldElementOp is clone as part of an hlfir::ElementalOp cloning.