================
@@ -629,6 +629,11 @@ static Value tryFoldCastChain(cir::CastOp op) {
 }
 
 OpFoldResult cir::CastOp::fold(FoldAdaptor adaptor) {
+  if (mlir::isa_and_present<PoisonAttr>(adaptor.getSrc())) {
+    // Propagate poison value
+    return PoisonAttr::get(getContext(), getType());
----------------
xlauko wrote:

```suggestion
    return cir::PoisonAttr::get(getType());
```

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

Reply via email to