[llvm] [DAG] SelectionDAG::canCreateUndefOrPoison - Mark AVGFLOORS and AVGCEILS as safe (PR #148191)

via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 11 05:03:00 PDT 2025


================
@@ -5542,6 +5542,10 @@ bool SelectionDAG::canCreateUndefOrPoison(SDValue Op, const APInt &DemandedElts,
   case ISD::UADDSAT:
   case ISD::SSUBSAT:
   case ISD::USUBSAT:
+  case ISD::AVGFLOORS:
+  case ISD::AVGFLOORU:
+  case ISD::AVGCEILS:
+  case ISD::AVGCEILU:
----------------
aabhinavg1 wrote:


HI @

Thanks for the feedback!

### Alive2 Proofs for AVG Operations

| Opcode       | Operation Type    | Alive2 Proof Link |
|--------------|-------------------|--------------------|
| `AVGFLOORS`  | Signed Floor Avg  | [Alive2 Link](https://alive2.llvm.org/ce/z/Dwy8a5) |
| `AVGCEILS`   | Signed Ceil Avg   | [Alive2 Link](https://alive2.llvm.org/ce/z/_JKF8A) |
| `AVGFLOORU`  | Unsigned Floor Avg| [Alive2 Link](https://alive2.llvm.org/ce/z/2-B6RM) |
| `AVGCEILU`   | Unsigned Ceil Avg | [Alive2 Link](https://alive2.llvm.org/ce/z/t5WZ6K) |



Let me know if need to add anything else.



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


More information about the llvm-commits mailing list