https://github.com/andykaylor commented:
I'm not sure we want to do this as part of our general canonicalization. It's a good optimization, but I don't think this kind of thing should be happening before the optimization phase. That may be true of most of our folders. I suppose this is a broad design decision that needs to be made. The way I have viewed clang in the past is that the clang component creates IR that faithfully models the semantics of the source code, and all optimizations should be left to the optimizer. That's a bit different than the general MLIR view, but I think that's because MLIR has mostly developed in a different environment from traditional compiler's like clang. I don't know if that means we shouldn't be running cir-canonicalize unconditionally, or if transformations like this should be implemented in cir-simplify. https://github.com/llvm/llvm-project/pull/147592 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits