[PATCH] D75964: [GC] Remove buggy untested optimization from statepoint lowering

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 10 16:26:20 PDT 2020


reames created this revision.
reames added reviewers: skatkov, dantrushin, anna.
Herald added subscribers: bollu, hiraditya, mcrosier.
Herald added a project: LLVM.

A downstream test case (still in the process of being properly reduced, will be added here) revealed that we have a bug in how we handle duplicate relocations.  If we have the same SDValue relocated twice, and that value happens to be a constant (such as null), we only export one of the two llvm::Values.  Exporting on a per llvm::Value basis is required to allow lowering of gc.relocates in following basic blocks (e.g. invokes).  Without it, we end up with a use of an undefined vreg and bad things happen.

Rather than fixing the optimization - which appears to be hard - I propose we simply remove it.  There are no tests in tree that change with this code removed. If we find out later that this did matter for something, we can reimplement a variation of this in CodeGenPrepare to catch the easy cases without complicating the lowering code.

Thanks to Denis and Serguei who did all the hard work of figuring out what went wrong here.  The patch is by far the easy part.  :)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D75964

Files:
  llvm/include/llvm/CodeGen/FunctionLoweringInfo.h
  llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75964.249510.patch
Type: text/x-patch
Size: 6260 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200310/1573bd28/attachment.bin>


More information about the llvm-commits mailing list