[PATCH] D95803: Ensure that InstructionCost actually implements a total ordering

Christopher Tetreault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 1 13:16:03 PST 2021


ctetreau marked 4 inline comments as done.
ctetreau added inline comments.


================
Comment at: llvm/unittests/Support/InstructionCostTest.cpp:42
 
+  EXPECT_TRUE((IThreeA < ITwo) || (IThreeA > ITwo) || (IThreeA == ITwo));
+  EXPECT_NE(IThreeA, ITwo);
----------------
ctetreau wrote:
> sdesmalen wrote:
> > Is there value in this test, if all three subexpressions have their expected value tested below?
> I left this test here because this is "the" failure. The next three lines just test the specific implementation that we have today, but if 42 fails then that means that there is not a total ordering of any sort.
I guess the value is pretty low (and this isn't even correct, we'd need 4 comparisons to ensure that exactly one of those returns true)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95803



More information about the llvm-commits mailing list