================
@@ -2479,6 +2479,39 @@ OpFoldResult cir::UnaryOp::fold(FoldAdaptor adaptor) {
       if (isBoolNot(previous))
         return previous.getInput();
 
+  // Fold constant unary operations.
+  if (auto srcConst = getInput().getDefiningOp<cir::ConstantOp>()) {
----------------
Lancern wrote:

> That said, WHICH direction we go (switch on kind, then type, vs type then 
> kind) doesn't seem particularly motivated in 1 way or the other?

I didn't quite know how MLIR would actually fold a sequence of operations. My 
guess was, given a sequence of CIR operations such as:

```
```

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

Reply via email to