[PATCH] D108433: [CSSPGO] split context string - compiler changes
Di Mo via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 25 10:31:39 PDT 2021
modimo added inline comments.
================
Comment at: llvm/include/llvm/ProfileData/SampleProf.h:547
+
+ bool operator!=(const SampleContext &That) const { return !(*this == That); }
+
----------------
hoy wrote:
> modimo wrote:
> > The == and != operators are not always opposites. If another instance of this object has the same State/Name/FullContext == and != will both evaluate as true. Should != check on all of these fields/be a direct negation of ==?
> Can you elaborate more? Why would `!=` return true for two objects having the same State/Name/FullContext?
Ah I missed that it was comparing the dereferenced `this` which is invoking the `==` operator directly. Thought it was comparing the pointers.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D108433/new/
https://reviews.llvm.org/D108433
More information about the llvm-commits
mailing list