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

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 17 02:22:27 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:
----------------
jayfoad wrote:

These proofs are weird: the whole point of the and/xor/ashr/add implementation is that you _don't_ need to extend to a wider type, you can do all operations in i8.

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


More information about the llvm-commits mailing list