Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZIR-330: [Picus] Muxes, backs, and more #164

Merged
merged 10 commits into from
Jan 17, 2025
Merged

Conversation

jacobdweightman
Copy link
Contributor

@jacobdweightman jacobdweightman commented Jan 17, 2025

  • Lowering of muxes, and conditionalization of alias layouts in muxes
  • Generate back functions for Picus, and inline backs with distance 0
  • Inline more builtin components, including Reg
  • Add picus_inline attribute so the programmer can force inlining in Picus code (necessary for Po2)
  • Incorporate access modifiers to reduce number of signals

@github-actions github-actions bot changed the title [Picus] Muxes, backs, and more ZIR-330: [Picus] Muxes, backs, and more Jan 17, 2025
@@ -175,13 +202,6 @@ class PicusPrinter {
valuesToSignals.insert({pack.getOut(), nullptr});
}

void visitOp(ExternOp ext) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this function no longer necessary? I still see a case for ExternOp in the switch above; is there some other overload which is meant to handle ExternOp now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that we were doing the same thing for all of the nondeterministic Zll ops, so I lumped them into a common implementation:

  // For nondeterministic operations, mark all results as fresh signals.
  void visitNondetOp(Operation* op) {
    for (Value result : op->getResults()) {
      Signal signal = Signal::get(ctx, freshName());
      valuesToSignals.insert({result, signal});
    }
  }

auto rhs = valuesToSignals.at(alias.getRhs());
for (auto [sl, sr] : llvm::zip(flatten(lhs), flatten(rhs))) {
os << "(assert (= " << sl.str() << " " << sr.str() << "))\n";
// If lhs and rhs have the same lifetime, then aliasing them is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for this clear explanation

@jacobdweightman jacobdweightman merged commit b11c5cb into main Jan 17, 2025
10 checks passed
@jacobdweightman jacobdweightman deleted the jacob/picus-muxes branch January 17, 2025 17:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants