This is an archive of the discontinued LLVM Phabricator instance.

[SCEV] Add operand methods to Exprs
ClosedPublic

Authored by samparker on Aug 17 2020, 8:34 AM.

Details

Summary

Preliminary patch for D86050 where it makes it much easier to write reusable code if the expressions have the same operand methods.

Diff Detail

Event Timeline

samparker created this revision.Aug 17 2020, 8:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 17 2020, 8:34 AM
Herald added a subscriber: hiraditya. · View Herald Transcript
samparker requested review of this revision.Aug 17 2020, 8:34 AM
lebedev.ri requested changes to this revision.Aug 17 2020, 8:48 AM
lebedev.ri added inline comments.
llvm/include/llvm/Analysis/ScalarEvolutionExpressions.h
77

I do not understand why you need std::array here.

op_range operands() const {
  return make_range(Op, Op+1);
}

will just work

296–298

Again, end() should be one-past-the-last element, not the last element.

This revision now requires changes to proceed.Aug 17 2020, 8:48 AM
samparker updated this revision to Diff 286224.Aug 18 2020, 2:02 AM

Thanks. Fixed up iterators

reames accepted this revision.Aug 21 2020, 8:30 AM

LGTM

This revision is now accepted and ready to land.Aug 21 2020, 9:07 AM
This revision was automatically updated to reflect the committed changes.