[clang] [CIR] Initial upstreaming of idiom recognizer pass (PR #172486)

Bruno Cardoso Lopes via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 13 14:57:16 PST 2026


================
@@ -27,6 +27,8 @@ std::unique_ptr<Pass> createHoistAllocasPass();
 std::unique_ptr<Pass> createLoweringPreparePass();
 std::unique_ptr<Pass> createLoweringPreparePass(clang::ASTContext *astCtx);
 std::unique_ptr<Pass> createGotoSolverPass();
+std::unique_ptr<Pass> createIdiomRecognizerPass();
+std::unique_ptr<Pass> createIdiomRecognizerPass(clang::ASTContext *astCtx);
----------------
bcardosolopes wrote:

> More generally, I can also imagine scenarios where you want to embed CIR into an executable (describing, for instance, kernels to be JITted and offloaded) and you wouldn't want to embed the entire AST. Certainly, it's reasonable to say that doing so might impose limitations on the types of optimizations that are possible.

I guess this will depend on how much detail from AST is needed, I generally believe we have a lot of room for raising high level information before getting even close to duplicating the full AST.

https://github.com/llvm/llvm-project/pull/172486


More information about the cfe-commits mailing list