Lines Matching defs:hlfir
1 //===- InlineElementals.cpp - Inline chained hlfir.elemental ops ----------===//
9 // at the hlfir.apply in the body of the second one (as described in
29 namespace hlfir {
32 } // namespace hlfir
36 static std::optional<std::pair<hlfir::ApplyOp, hlfir::DestroyOp>>
37 getTwoUses(hlfir::ElementalOp elemental) {
46 if (hlfir::elementalOpMustProduceTemp(elemental))
49 hlfir::ApplyOp apply;
50 hlfir::DestroyOp destroy;
53 .Case([&](hlfir::ApplyOp op) { apply = op; })
54 .Case([&](hlfir::DestroyOp op) { destroy = op; });
61 auto yield = mlir::dyn_cast_or_null<hlfir::YieldElementOp>(
63 assert(yield && "hlfir.elemental should always end with a yield");
72 : public mlir::OpRewritePattern<hlfir::ElementalOp> {
74 using mlir::OpRewritePattern<hlfir::ElementalOp>::OpRewritePattern;
77 matchAndRewrite(hlfir::ElementalOp elemental,
79 std::optional<std::pair<hlfir::ApplyOp, hlfir::DestroyOp>> maybeTuple =
83 elemental, "hlfir.elemental does not have two uses");
91 "hlfir.elemental is ordered");
100 hlfir::YieldElementOp yield = hlfir::inlineElementalOp(
115 : public hlfir::impl::InlineElementalsBase<InlineElementalsPass> {