This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Add hasTerminator helper function to Block
AbandonedPublic

Authored by springerm on Dec 24 2021, 6:18 AM.

Details

Summary

Such functionality is used in various places.

Diff Detail

Event Timeline

springerm created this revision.Dec 24 2021, 6:18 AM
springerm requested review of this revision.Dec 24 2021, 6:18 AM
mehdi_amini added inline comments.Dec 24 2021, 2:16 PM
mlir/lib/IR/Block.cpp
264

Should we name this mightHaveTerminator()?

springerm added inline comments.Dec 25 2021, 12:54 AM
mlir/lib/IR/Block.cpp
264

What's your reasoning? A block either has a terminator or not.

springerm added inline comments.Dec 25 2021, 1:10 AM
mlir/lib/IR/Block.cpp
264

I see, to account for unregistered ops. All code locations that I found are actually looking for terminators, not may-be-terminators.

mehdi_amini added inline comments.Dec 25 2021, 1:13 AM
mlir/lib/IR/Block.cpp
264

Yes, it’s tricky because there is no definitive answer for unregistered ops…

For example right now !hasTerminator() does not mean no terminator , so I’d name it hasRegisteredTerminator to be exact

mehdi_amini accepted this revision.Dec 25 2021, 12:01 PM
This revision is now accepted and ready to land.Dec 25 2021, 12:01 PM
springerm abandoned this revision.Jan 5 2023, 1:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 5 2023, 1:25 AM