Details
- Reviewers
rriddle mehdi_amini
Diff Detail
Event Timeline
is there interest in having this upstream ?
I am not sure how it should be tested upstream ?
for context I needed this to build a pass that remove all cross block uses and instead pass all value by block arguments. there is not no support for switch ops because they never happen in my context so i don't know if it can be up-streamed as a test.
CondBranchOp has getTrueDestOperandsMutable() and getFalseDestOperandsMutable() methods that return a MutableOperandRange. That class is what we should be using, as it has support for assignment/erasing/etc. We can extend MutableOperandRange if some necessary functionality is missing.
Switch op provides similar functions for accessing the MutableOperandRange (e.g. getCaseOperandsMutable)
Please feel free to open a patch adding any necessary functionality to MutableOperandRange! It's possible it might be missing something useful, so patches definitely welcome.