Fix one encountered (issue #57072) and two potential scenarios where the
code would ask for an operand that isn't there.
Add test for the encountered case.
Differential D131671
[flang]Avoid asking for operands when there are none Leporacanthicus on Aug 11 2022, 5:31 AM. Authored by
Details Fix one encountered (issue #57072) and two potential scenarios where the Add test for the encountered case.
Diff Detail
Event TimelineComment Actions Thank you for the changes, but I think this is not enough in general, so it may still make sense to make this code "experimental" for the time being. I would like to enable the pass in the driver so that DOT_PRODUCT inlining kicks in, but I cannot do this because SUM inlining fails many tests. TBH, I also see issues with DOT_PRODUCT inlining currently, but I hope I will be able to resolve them soon and enable the pass in the driver.
Comment Actions My internal testing passed with this patch and the pass enabled in the driver, so it should probably be okay. At the same time, I am still uncomfortable with the wide range of operations that we pass through during the analysis. Can you please check explicitly for operations expected in the chain, i.e. check explicitly for fir.convert and return conservative results otherwise? Comment Actions Updated check for expected operation (always fir::ConvertOp) instead of Remove spurious include of iostream.
|
I do not think the check above is enough. As I understand, the main goal of this code is to skip fir.convert, but we should expect that we can meet any instruction producing !fix.box, e.g. consider that previous passes generated fir.store/fir.load of a !fir.box in the middle for whatever reason. I think we should actually check for a set of expected operations in the chain and bail out otherwise.