When rank > 1, the inital value would be lost on inner loops, leading to the wrong
value to be returned, e.g. This would return T. This patch fixes this to use the correct
inital value for all cases.
Integer :: m(0,10) Any(m .eq 0)
Paths
| Differential D143899
[Flang] Fix for Any/All simplification to properly propogate the inital value ClosedPublic Authored by SBallantyne on Feb 13 2023, 3:16 AM.
Details Summary When rank > 1, the inital value would be lost on inner loops, leading to the wrong Integer :: m(0,10) Any(m .eq 0)
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project. · View Herald TranscriptFeb 13 2023, 3:16 AM Comment Actions Aside from minor nit-picks, this looks good to me.
This revision is now accepted and ready to land.Feb 13 2023, 1:41 PM Closed by commit rG98ecc3ac77a9: [Flang] Fix for Any/All simplification to properly propogate the inital value (authored by SBallantyne, committed by kiranchandramohan). · Explain WhyFeb 14 2023, 2:36 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 497255 flang/lib/Optimizer/Transforms/SimplifyIntrinsics.cpp
flang/test/Transforms/simplifyintrinsics.fir
|
It's considered poor style [yes, I do this too, "do as I say, not as I do"] to introduce "other changes" with a bug-fix.
At the very least, it should be mentioned in the commit message as "Also removed some debug output code". It really doesn't hurt much to leave it in there, but don't undo this just because I said - more of "try to avoid in future".