[PATCH] D35057: [SafepointIRVerifier] Avoid false positives in GC verifier for compare between pointers

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 6 21:43:13 PDT 2017


skatkov accepted this revision.
skatkov added inline comments.
This revision is now accepted and ready to land.


================
Comment at: lib/IR/SafepointIRVerifier.cpp:390
+            // pointer.
+            if (AvailableSet.count(LHS) || AvailableSet.count(RHS))
+              return false;
----------------
anna wrote:
> skatkov wrote:
> > if both parts are true it means both are relocated pointers, why do we return false? Did I miss anything?
> The reason is because we are interested only in valid *unrelocated* uses. This happens only when both operands are unrelocated: these operands are either null, constant pointers or non-constant pointers (please see the comment above: lines 383).
> Returning false when either are relocated simplifies the checks in this lambda -- because we know that from this point on it's unrelocated uses that we are interested in.
> Also, the case where bother are relocated is automatically handled in the checks following the call to this lambda. 
> 
Got it. It is not a bool algebra :) !hasValidUnrelocatedUse does not mean has invalid :) it means has not or has invalid.


https://reviews.llvm.org/D35057





More information about the llvm-commits mailing list