45 error(
"affine.op.mul should have been rewritten to affine.semiop.mul and then to core.mul");
60 error(
"affine: lowering of semiop `{}` is not yet implemented (needs %core.div with a %mem.M token)",
71 auto ins = idxs->projs();
72 auto lifted = w.tuple(
73 DefVec(ins.size(), [&](
size_t i) { return w.call(core::conv::u, w.lit_i64(), ins[i]); }));
75 auto outs = w.app(f, lifted)->projs();
76 return w.tuple(
DefVec(outs.size(), [&](
size_t j) {
78 auto sout_j = res_ty->proj(outs.size(), j)->as<App>()->arg();
79 return w.call(core::conv::u, sout_j, outs[j]);
83 return RWPhase::rewrite_imm_App(app);
const Def * callee() const
static auto isa(const Def *def)
auto projs(F f) const
Splits this Def via Def::projections into an Array (if A == std::dynamic_extent) or std::array (other...
const Def * type() const noexcept
Yields the "raw" type of this Def (maybe nullptr).
World & new_world()
Create new Defs into this.
bool is_bootstrapping() const
Returns whether we are currently bootstrapping (rewriting annexes).
virtual const Def * rewrite(const Def *)
const Def * rewrite_imm_App(const App *) final
const Def * rewrite(const Def *) final
Vector< const Def * > DefVec
void error(std::format_string< Args... > fmt, Args &&... args)
Wraps std::format to throw T with a formatted message.