[llvm] [InstCombine] Fold isnan idioms (PR #101510)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 1 09:50:41 PDT 2024


================
@@ -339,8 +339,8 @@ static Value *foldLogOpOfMaskedICmps_NotAllZeros_BMask_Mixed(
   //
   // We currently handle the case of B, C, D, E are constant.
   //
-  const APInt *BCst, *CCst, *DCst, *OrigECst;
-  if (!match(B, m_APInt(BCst)) || !match(C, m_APInt(CCst)) ||
+  const APInt *BCst, *DCst, *OrigECst;
+  if (!match(B, m_APInt(BCst)) || !match(C, m_Zero()) ||
----------------
dtcxzyw wrote:

See also https://github.com/llvm/llvm-project/blob/2a5f7e58d71c394b241fdd1d905041ad0537acab/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp#L76-L114 and https://github.com/llvm/llvm-project/blob/2a5f7e58d71c394b241fdd1d905041ad0537acab/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp#L446-L479

`Mask_NotAllZeros` stands for the pattern `icmp ne (A & B), 0`.


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


More information about the llvm-commits mailing list