[all-commits] [llvm/llvm-project] 96a0d7: Revert "ValueTracking: Identify implied fp classes...

Hans via All-commits all-commits at lists.llvm.org
Fri Nov 10 05:46:19 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 96a0d714d58e48c363ee6abbbcdfd7a6ce646ac1
      https://github.com/llvm/llvm-project/commit/96a0d714d58e48c363ee6abbbcdfd7a6ce646ac1
  Author: Hans Wennborg <hans at chromium.org>
  Date:   2023-11-10 (Fri, 10 Nov 2023)

  Changed paths:
    M llvm/include/llvm/Analysis/ValueTracking.h
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/test/Transforms/Attributor/nofpclass-implied-by-fcmp.ll
    M llvm/test/Transforms/InstSimplify/assume-fcmp-constant-implies-class.ll

  Log Message:
  -----------
  Revert "ValueTracking: Identify implied fp classes by general fcmp (#66505)"

This causes asserts to fire:

  llvm/lib/Analysis/ValueTracking.cpp:4262:
  std::tuple<Value *, FPClassTest, FPClassTest> llvm::fcmpImpliesClass(CmpInst::Predicate, const Function &, Value *, const APFloat *, bool):
  Assertion `(RHSClass == fcPosNormal || RHSClass == fcNegNormal || RHSClass == fcPosSubnormal || RHSClass == fcNegSubnormal) && "should have been recognized as an exact class test"' failed.

See comments on the PR.

> Previously we could recognize exact class tests performed by
> an fcmp with special values (0s, infs and smallest normal).
> Expand this to recognize the implied classes by a compare with a general
> constant. e.g. fcmp ogt x, 1 implies positive and non-0.
>
> The API should be better merged with fcmpToClassTest but that
> made the diff way bigger, will try to do that in a future
> patch.

This reverts commit dc3faf0ed0e3f1ea9e435a006167d9649f865da1.




More information about the All-commits mailing list