This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add VectorType::Builder to more easily build vector types from existing ones
ClosedPublic

Authored by nicolasvasilache on Nov 15 2021, 2:30 AM.

Diff Detail

Event Timeline

nicolasvasilache requested review of this revision.Nov 15 2021, 2:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2021, 2:30 AM
springerm accepted this revision.Nov 15 2021, 2:32 AM
This revision is now accepted and ready to land.Nov 15 2021, 2:32 AM
This revision was landed with ongoing or failed builds.Nov 15 2021, 2:37 AM
This revision was automatically updated to reflect the committed changes.
mehdi_amini added inline comments.Nov 15 2021, 10:18 AM
mlir/include/mlir/IR/BuiltinTypes.h
342

Is this right? Seems like the newShape SmallVector lifetime ends with this function, but the Builder keeps a reference to it.

mehdi_amini added inline comments.Nov 15 2021, 10:21 AM
mlir/include/mlir/IR/BuiltinTypes.h
342

Oh is it that this method returns a Type which forces to invoke the VectorType operator below?
So the returned object is OK but the Builder is basically busted?
This seems like a fragile API to me.

rriddle added inline comments.Nov 15 2021, 11:52 AM
mlir/include/mlir/IR/BuiltinTypes.h
342

Yeah, this doesn't look ideal. Can we just create a copy of this builder and set the shape?

ughh, sorry you're right I mess up the builder for nothing .. will send a followup shortly