[llvm] [ValueTracking] Add support for overflow detection functions is `isKnownNonZero` (PR #87701)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 9 01:24:22 PDT 2024


================
@@ -2786,6 +2791,32 @@ static bool isKnownNonZeroFromOperator(const Operator *I,
     // handled in isKnownNonZero.
     return false;
   }
+  case Instruction::ExtractValue: {
+    const WithOverflowInst *WO;
+    if (match(I, m_ExtractValue<0>(m_WithOverflowInst(WO)))) {
+      switch (WO->getIntrinsicID()) {
----------------
nikic wrote:

Could slightly simplify this by matching on getBinaryOp(). 

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


More information about the llvm-commits mailing list