[PATCH] D15940: Add verifier pass for finding GC relocation bugs

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 6 16:29:11 PST 2016


reames created this revision.
reames added reviewers: JosephTremoulet, pgavlin, swaroop.sridhar, sanjoy.
reames added a subscriber: llvm-commits.
Herald added a subscriber: sanjoy.

RewriteStatepointsForGC tries to rewrite a function in a manner where the optimizer can't end up using a pointer value after it might have been relocated by a safepoint.  This pass checks the invariant that RSForGC is supposed to establish and that (if we constructed semantics correctly) later passes must preserve.  

This has been a really useful diagnostic tool when initially developing the rewriting scheme and has found numerous bugs.  Manuel recently pointed out that this had never gotten upstreamed.  Given both Manuel and the Microsoft team are in the process of trying to ramp up both the amount of IR being fed through and the optimization passes run, it seems useful to have this available for them as well.  Manuel in particular has already found and fixed a couple of relocation bugs the hard way.

In terms of placement and structure, I left this in the IR directory which is where we'd happened to drop it in our tree.  I could see an argument that this should be in either Analysis or possibly Transform.  I'm happy to move it if anyone has a preference.  

http://reviews.llvm.org/D15940

Files:
  include/llvm/IR/SafepointIRVerifier.h
  include/llvm/InitializePasses.h
  lib/IR/CMakeLists.txt
  lib/IR/Core.cpp
  lib/IR/SafepointIRVerifier.cpp
  test/SafepointIRVerfier/basic-use-after-reloc.ll
  test/SafepointIRVerfier/unrecorded-live-at-sp.ll
  test/SafepointIRVerfier/uses-in-phi-nodes.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D15940.44168.patch
Type: text/x-patch
Size: 23827 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160107/1070ff4b/attachment.bin>


More information about the llvm-commits mailing list