Page MenuHomePhabricator

[mlir] Provide LLVMType::getPrimitiveSizeInBits

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



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

can you add a parenthesis with examples?


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.