[llvm] [InstCombine] Fold fcmp ogt (x - y), 0 into fcmp ogt x, y #85245 (PR #85506)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Sat Mar 16 23:21:55 PDT 2024
================
@@ -7972,6 +7972,11 @@ Instruction *InstCombinerImpl::visitFCmpInst(FCmpInst &I) {
Constant *RHSC;
if (match(Op0, m_Instruction(LHSI)) && match(Op1, m_Constant(RHSC))) {
switch (LHSI->getOpcode()) {
+ case Instruction::FSub:
+ if (Pred == FCmpInst::FCMP_OGT && match(RHSC, m_PosZeroFP()) &&
+ match(LHSI, m_OneUse(m_FSub(m_Value(X), m_Value(Y)))))
----------------
dtcxzyw wrote:
The one-use check here is unnecessary.
https://github.com/llvm/llvm-project/pull/85506
More information about the llvm-commits
mailing list