llvm-project
f26b30ea - [CIR] Auto-generate matchAndRewrite for one-to-one CIR-to-LLVM lowerings (#190326)

Commit
26 days ago
[CIR] Auto-generate matchAndRewrite for one-to-one CIR-to-LLVM lowerings (#190326) When a CIR op specifies a non-empty `llvmOp` field, the lowering emitter now generates the `matchAndRewrite` body that converts the result type and forwards all operands to the corresponding LLVM op. This removes 27 boilerplate lowering patterns from LowerToLLVM.cpp. Ops needing custom logic (FMaxNumOp/FMinNumOp for FastmathFlags::nsz) override `llvmOp = ""` to retain hand-written implementations. Also fixes llvmOp names (TruncOp -> FTruncOp, FloorOp -> FFloorOp) and adds a diagnostic rejecting conflicting llvmOp + custom constructor.
Author
Parents
Loading