================
@@ -108,4 +112,12 @@ mlir::Operation *LowerItaniumCXXABI::lowerGetRuntimeMember(
                              cir::CastKind::bitcast, memberBytesPtr);
 }
 
+mlir::Value
+LowerItaniumCXXABI::lowerDataMemberCmp(cir::CmpOp op, mlir::Value loweredLhs,
+                                       mlir::Value loweredRhs,
+                                       mlir::OpBuilder &builder) const {
+  return cir::CmpOp::create(builder, op.getLoc(), op.getKind(), loweredLhs,
----------------
Lancern wrote:

> It may be that at some point in the past there was an intention for this 
> lowering to happen as a CIR-to-CIR transform, similar to LoweringPrepare.

I have an ongoing PR in the incubator https://github.com/llvm/clangir/pull/1471 
which tries to add a CIR-to-CIR pass dedicated to ABI lowering. It's a bit out 
of sync now because recently I do not get enough bandwidth to work on that. I 
feel it's sub-optimal to mix ABI lowering work in the process of LLVMLowering 
like what we're doing now, because:

1. It complicates the lowering process and confuses people. I could remember at 
least three times reviewers were confused by patches to LLVMLowering which also 
contain ABI lowering work.
2. It also makes debugging trickier because while it's easy to dump IRs between 
passes, it's relatively harder to see what happens during a pass.
3. Besides LLVMLowering, we also have a MLIRLowering route. Writing ABI 
lowering code in LLVMLowering does not help the MLIRLowering route, and it's 
likely we have to re-implement ABI lowering code in MLIRLowering again. Moving 
ABI lowering code to a dedicated pass before LLVMLowering also benefits 
MLIRLowering.

https://github.com/llvm/llvm-project/pull/171897
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to