Lowering is pretty much a copy of AtomicRMWOp -> llvm.cmpxchg
pattern.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
What should we do with the lowering for AtomicRMWOp "minf", "maxf"? Should we lower it to GenericAtomicRMWOp and then to LLVM? Or maybe we should not use AtomicRMWOp for these cases at all? It can always be replaced by GenericAtomicRMWOp.
OK, I could see always lowering enums that would lower to cmpxchg via the generic op. But at the moment we have a higher layer that uses the enumerated version for min/max, so I'd prefer to don't remove that. It's much easier to pattern match (even declaratively) the enumerated version than the one with a region.
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp | ||
---|---|---|
2796 | This is not allowed in conversion patterns (it is not undoable). I've recently introduced a functionality to create block in a rewriter-compatible way, rewriter.createBlock(initBlock->getParent(), std::next(Region::iterator(initBlock)), valueType); should work. |
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp | ||
---|---|---|
2796 | Thanks a lot, Alex. Good to know that it is not allowed. I ll send a patch to fix this. |
This is not allowed in conversion patterns (it is not undoable). I've recently introduced a functionality to create block in a rewriter-compatible way, rewriter.createBlock(initBlock->getParent(), std::next(Region::iterator(initBlock)), valueType); should work.