================
@@ -142,7 +142,8 @@ void CIRCanonicalizePass::runOnOperation() {
     // Many operations are here to perform a manual `fold` in
     // applyOpPatternsGreedily.
     if (isa<BrOp, BrCondOp, CastOp, ScopeOp, SwitchOp, SelectOp, UnaryOp,
-            VecExtractOp, VecShuffleOp, VecShuffleDynamicOp, VecTernaryOp>(op))
+            VecExtractOp, VecShuffleOp, VecShuffleDynamicOp, VecSplatOp,
+            VecTernaryOp>(op))
----------------
bcardosolopes wrote:

This folder isn't always profitable, for example, if we are optimizing for size 
it might be worse to have the splat being encoded as a constant vector in the 
data section (versus using a instruction that can splat the value).

I think this makes more sense as part of CIRSimplify instead (I think we are 
still good with the others vector folders being here though). At some point 
we'll need to make the configuration of these folders dependent on the 
optimization level and more accurately reflect O2 vs Oz and things like that.

Future work food for thought: we might also wanna revisit the pass names. 
MLIR's "canonicalizer" is aggressive and make transformations that optimize 
code (folders followed by DCE). In ClangIR, the CIRCanonicalizer is currently 
only about removing some redundancy that wouldn't affect analysis (while 
CIRSimplify is where we get aggressive).

https://github.com/llvm/llvm-project/pull/143771
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to