phate / jlm

GNU Lesser General Public License v2.1
44 stars 14 forks source link

Missing lambda attributeset `==` operator #525

Open ProgrammingLouis opened 5 days ago

ProgrammingLouis commented 5 days ago

As discussed in #492, I'm working on implementing a graph equivalence function in jlm.

The issue is that the lambda == operator calls this attributeset == operator which is not implemented

In jlm/llvm/ir/attribute.hpp :

class attributeset final

...

bool
  operator==(const attributeset & other) const noexcept
  {
    /*
      FIXME: Ah, since this is not a real set, we cannot cheaply implement a comparison.
    */
    return false;
  }

Also, if I want to implement it myself there need to be a choice on the attributeset implementation here which has not been addressed.

class attributeset final

...

private:
  /*
    FIXME: Implement a proper set. Elements are not unique here.
  */
  std::vector<std::unique_ptr<attribute>> attributes_;

@phate @sjalander

phate commented 5 days ago

I can take a look at it, but it might take a while with the holidays coming up.

phate commented 4 days ago

I had a look at it today. I think I found a way to support it with some limited engineering effort. I should have a PR ready in the next few days.

ProgrammingLouis commented 4 days ago

Ok, thank you. Please tag me in the PR when it's ready.