This is an archive of the discontinued LLVM Phabricator instance.

[mlir][spirv] Infer converted type of scf.for from the init value
ClosedPublic

Authored by ThomasRaoux on Aug 25 2020, 5:14 PM.

Details

Summary

Instead of using the TypeConverter infer the value of the alloca created based on the init value. This will allow some ambiguous types like multidimensional vectors to be converted correctly.

Diff Detail

Event Timeline

ThomasRaoux created this revision.Aug 25 2020, 5:14 PM
ThomasRaoux requested review of this revision.Aug 25 2020, 5:14 PM
mravishankar accepted this revision.Aug 25 2020, 9:43 PM
mravishankar added inline comments.
mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp
188

Maybe add some context for this so that coming back to this later, we can know why it was done this way.

This revision is now accepted and ready to land.Aug 25 2020, 9:43 PM

Add extra comment

Thanks Mahesh for the review. I added extra context explaining why we do it that way and we can revisit later.

mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp
188

Good point. Added more context.