This fixes the case where scf::LoopNest::loops is empty.
Change LoopVector and ValueVector to SmallVector.
Differential D136926
[mlir] Change scf::LoopNest to store 'results'. csigg on Oct 28 2022, 1:31 AM. Authored by
Details This fixes the case where scf::LoopNest::loops is empty. Change LoopVector and ValueVector to SmallVector.
Diff Detail
Event Timeline
Comment Actions This is missing a test.
Comment Actions
That is your opinion, but the API is currently used for all three cases and avoiding the foot-gun for 3. is an orthogonal improvement. I noticed only now that this change allows cleaning up a TODO item in the test.
Comment Actions Sync'd offline with Alex who authored this builder. My objection is I view buildX that 1. does not create X and 2. does not fail but 3. does something else as problematic. OTOH Alex justly remarked that scf::buildLoopNest is not the same as scf::buildScfForOps and that it builds some abstract loop nest that we are ok defining as "empty loop nest with the builder called once". Leaving @ftynse with the approval decision once this LGTH. Comment Actions Thanks for reviewing and sorry for the delay. Just to be clear, although I think it's a minor improvement, I'm not attached to this change. If you prefer to keep things as is, I will just abandon it.
|
Thanks for cleaning this up.