[PATCH] D143279: InstCombine: Handle folding fcmp of 0 into llvm.is.fpclass
Jay Foad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Feb 6 02:04:27 PST 2023
foad added inline comments.
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1272
switch (Pred) {
-#if 0
// TODO: Compares with 0 depends on the denormal handling mode.
case FCmpInst::FCMP_OEQ: // Match x == 0.0
----------------
This is done?
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1278
case FCmpInst::FCMP_UNE: // Match (x != 0.0)
return {LHS, (~fcZero & fcAllFlags) | fcNan};
case FCmpInst::FCMP_ONE: // Match !isnan(x) && x != 0.0
----------------
Simplify this to `~fcZero & fcAllFlags`
================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1499
+ auto [ClassValRHS, ClassMaskRHS] =
+ fcmpToClassTest(PredR, *RHS->getParent()->getParent(), RHS0, RHS1);
if (ClassValRHS) {
----------------
You can use getFunction, here and below
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D143279/new/
https://reviews.llvm.org/D143279
More information about the llvm-commits
mailing list