[PATCH] D110907: [NewGVN] Use PredicateInfo info when previously used for the same ssa.coy intrinsic

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 30 23:37:33 PDT 2021


asbirlea created this revision.
asbirlea added reviewers: fhahn, nikic, davide.
Herald added a subscriber: hiraditya.
asbirlea requested review of this revision.
Herald added a project: LLVM.

Symbolic execution using PredicateInfo is only done for the ssa.copy
intrinsic. It's using two potential sources for building the expression:

1. the Value of the instruction for which the instruction is a copy of, and
2. the Value from the contraint in PredicateInfo

It's possible to get into an infinite loop when choosing between these
two, as described in PR31613.

This patch proposes performing swapping of the two values (i.e. choosing
the second one for the expression), if that same second value was chosen
before; this breaks the cycle.

In the testcases provided, where there is a contradiction between the
value from symbolic execution and assume instruction, NewGVN reduces the
assume to assume(false).

Resolves PR31613.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110907

Files:
  llvm/lib/Transforms/Scalar/NewGVN.cpp
  llvm/test/Transforms/NewGVN/pr31613_2.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110907.376428.patch
Type: text/x-patch
Size: 8837 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211001/9142bfa4/attachment.bin>


More information about the llvm-commits mailing list