================
@@ -110,9 +110,10 @@ class CIRGenConsumer : public clang::ASTConsumer {
if (!FEOptions.ClangIRDisablePasses) {
// Setup and run CIR pipeline.
+ bool EnableLoweringPrepare = Action != CIRGenAction::OutputType::EmitCIR;
----------------
andykaylor wrote:
I would prefer defaulting to printing CIR before LoweringPrepare. The specific
case that motivated this for me was `cir.complex.div` which gets expanded to a
sequence of operations that may be difficult to identify as a complex division.
However, I think there will be other cases where LoweringPrepare is eliminating
useful abstractions or complicating control flow.
In general, I want to think of `-emit-cir` as producing the same CIR form that
would be consumed by any client that processes CIR directly before lowering to
LLVM IR. In practice, I expect initial development of clients that want to
consume CIR to be implemented by consuming a file-based CIR before they are
fully integrated with clang.
I agree that we should have the same behavior in the incubator as upstream, but
in this case the larger number of tests in the incubator will make it more work
to switch over, so I'd be inclined to change it here and then backport to the
incubator.
https://github.com/llvm/llvm-project/pull/154107
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits