[PATCH] D55678: [CVP] Use LVI to constant fold deopt operands

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 13 14:51:14 PST 2018


reames created this revision.
reames added reviewers: anna, sanjoy.
Herald added subscribers: bollu, mcrosier.

Deopt operands are generally intended to record information about a site in code with minimal perturbation of the surrounding code.  Idiomatically, they also tend to appear down rare paths.  Putting these together, we have an obvious case for extending CVP w/deopt operand constant folding.  Arguably, we should be doing this for all operands on all instructions, but that's definitely a much larger and risky change.

A few items to note for the review:

- The const_cast is definitely ugly, but the API for operand bundles seemed to require it.  Is there a better way to structure this?
- As noted w/a TODO, I initially tried to use a context instruction here, but discovered that the result returned by LVI was actually wrong.  It seemed return something true *after* the context instruction, not before it.  For an instruction like a guard or assume, that difference is quite material!


Repository:
  rL LLVM

https://reviews.llvm.org/D55678

Files:
  lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
  test/Transforms/CorrelatedValuePropagation/deopt.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55678.178142.patch
Type: text/x-patch
Size: 4364 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181213/de68cfa9/attachment.bin>


More information about the llvm-commits mailing list