This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Provide LLVMType::getPrimitiveSizeInBits
ClosedPublic

Authored by ftynse on Aug 12 2020, 10:21 AM.

Details

Summary

This function is available on llvm::Type and has been used by some clients of
the LLVM dialect before the transition. Implement the MLIR counterpart.

Diff Detail

Event Timeline

ftynse created this revision.Aug 12 2020, 10:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 12 2020, 10:21 AM
ftynse requested review of this revision.Aug 12 2020, 10:21 AM
mehdi_amini added inline comments.Aug 15 2020, 5:21 PM
mlir/include/mlir/Dialect/LLVMIR/LLVMTypes.h
110

can you add a parenthesis with examples?

mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp
64

It is a bit "unsafe" to have a catch all here: we can't easily check that we correctly covered all the "sized" types.
Can we list all the types here in a assert(isa<...>) ?

ftynse updated this revision to Diff 286011.Aug 17 2020, 6:56 AM
ftynse marked 2 inline comments as done.

Address review.

schweitz accepted this revision.Aug 17 2020, 8:54 AM

Thanks for adding this.

This revision is now accepted and ready to land.Aug 17 2020, 8:54 AM
This revision was automatically updated to reflect the committed changes.