[llvm] [ValueTracking] Handle more integer intrinsics in `propagatesPoison` (PR #82749)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 03:06:08 PST 2024


================
@@ -7189,11 +7189,28 @@ bool llvm::propagatesPoison(const Use &PoisonOp) {
       case Intrinsic::uadd_with_overflow:
       case Intrinsic::usub_with_overflow:
       case Intrinsic::umul_with_overflow:
+      case Intrinsic::sadd_sat:
+      case Intrinsic::ssub_sat:
+      case Intrinsic::sshl_sat:
+      case Intrinsic::uadd_sat:
+      case Intrinsic::usub_sat:
+      case Intrinsic::ushl_sat:
         // If an input is a vector containing a poison element, the
         // two output vectors (calculated results, overflow bits)'
         // corresponding lanes are poison.
         return true;
       case Intrinsic::ctpop:
+      case Intrinsic::ctlz:
+      case Intrinsic::cttz:
+      case Intrinsic::abs:
+      case Intrinsic::smax:
+      case Intrinsic::smin:
+      case Intrinsic::umax:
+      case Intrinsic::umin:
+      case Intrinsic::bitreverse:
+      case Intrinsic::bswap:
+      case Intrinsic::fshl:
+      case Intrinsic::fshr:
----------------
nikic wrote:

Please drop fshl / fshr. I consider their implementation in alive2 buggy, and they shouldn't full propagate poison if the shift amount if zero.

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


More information about the llvm-commits mailing list