[llvm] [InstCombine] FP fold, cond ? x : -x == 0 into x == 0 #85250 (PR #85673)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 23 04:04:09 PDT 2024


================
@@ -7972,6 +7972,13 @@ Instruction *InstCombinerImpl::visitFCmpInst(FCmpInst &I) {
   Constant *RHSC;
   if (match(Op0, m_Instruction(LHSI)) && match(Op1, m_Constant(RHSC))) {
     switch (LHSI->getOpcode()) {
+    case Instruction::Select:
+      if ((Pred == FCmpInst::FCMP_UEQ || Pred == FCmpInst::FCMP_OEQ ||
----------------
dtcxzyw wrote:

> I'm concerned this (half nofpclass(inf nan norm sub) %y) might cause test failures.

It is for alive2 proof, but not for tests.


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


More information about the llvm-commits mailing list