[PATCH] D108573: [VPlan] Introduce code to limit querying VPValues using IR references.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 23 12:34:28 PDT 2021


fhahn created this revision.
fhahn added reviewers: gilr, Ayal, rengolin.
Herald added subscribers: tschuett, psnobl, rogfer01, bollu, hiraditya.
fhahn requested review of this revision.
Herald added a subscriber: vkmr.
Herald added a project: LLVM.

After applying VPlan-to-VPlan transformations, using IR references to
query VPlan values may be incorrect, as the IR is not in sync with the
VPlan any longer.

To better detect such mis-matches, this patch introduces a new flag to
VPlans to indicate whether it is safe to query VPValues using IR values.

getVPValue is updated to assert if it is called when the flag indicates
it is not safe any longer.

There is an escape hatch via an extra argument, because there are 3
places that need to be fixed first. Those are

1. truncateToMinimalBitwidths
2. clearReductionWrapFlags
3. fixLCSSAPHIs

As a first step, this flag will help preventing new code from violating
this property.

Any suggestions with respect to naming very welcome!


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D108573

Files:
  llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
  llvm/lib/Transforms/Vectorize/VPlan.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D108573.368175.patch
Type: text/x-patch
Size: 4577 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210823/60339e6e/attachment.bin>


More information about the llvm-commits mailing list