[PATCH] D144081: InstCombine: Fold and/or of fcmp into class

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 21 18:19:52 PST 2023


arsenm added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp:1503
+  // single fcmp with fneg and fabs, that's likely a better canonical form.
+  if (LHS->hasOneUse() && RHS->hasOneUse()) {
+    auto [ClassValRHS, ClassMaskRHS] = fcmpToClassTest(PredR, RHS0, RHS1);
----------------
arsenm wrote:
> arsenm wrote:
> > foad wrote:
> > > Do you need to worry about `IsLogicalSelect` here? (@nikic, @craig.topper?)
> > I've tried to come up with a case where it mattered and I can't seem to find one
> I managed to get a case where it's true with fast math flags. Will check what alive2 thinks
https://alive2.llvm.org/ce/z/s58K3N is the case, seems to be fine


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144081/new/

https://reviews.llvm.org/D144081



More information about the llvm-commits mailing list