Convert fir.insert_on_range operation to corresponding
llvm.insertvalue operations.
This patch is part of the upstreaming effort from fir-dev branch.
Differential D112896
[fir] Add fir.insert_on_range conversion Authored by clementval on Oct 31 2021, 2:04 PM.
Details Convert fir.insert_on_range operation to corresponding This patch is part of the upstreaming effort from fir-dev branch.
Diff Detail
Event TimelineComment Actions Looks good in general, just some minor comments inline.
Comment Actions Address review comments
Comment Actions Thanks for the review @mehdi_amini. I'll wait until the verifier is updated to land this. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Nit: seems like it could be using llvm::all_of:
return llvm::all_of(operands, [] (Value opnd) { auto *defop = opnd.getDefiningOp(); return defop && isa<mlir::LLVM::ConstantOp, mlir::arith::ConstantOp>(defop); });Should this use isConstantLike? https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/IR/Matchers.h#L53-L56
return llvm::all_of(operands, [] (Value opnd) { auto *defop = opnd.getDefiningOp(); return defop && isConstantLike(defop); });