[PATCH] D94447: [PredicateInfo] Generalize processing of conditions

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 11 13:44:05 PST 2021


nikic created this revision.
nikic added a reviewer: fhahn.
Herald added a subscriber: hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Branch/assume conditions in PredicateInfo are currently handle in a rather ad-hoc manner, with some arbitrary limitations. For example, an and of two icmps will be handled, but an and of an icmp and some other condition will not. That also includes the case where more than two conditions and and'ed together.

This patch makes the handling more general by looking through an arbitrary number of ands/ors and considering all kinds of conditions (though operands will only be taken for cmps of course).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D94447

Files:
  llvm/lib/Transforms/Utils/PredicateInfo.cpp
  llvm/test/Transforms/NewGVN/assume-equal.ll
  llvm/test/Transforms/SCCP/conditions-ranges.ll
  llvm/test/Transforms/Util/PredicateInfo/condprop.ll
  llvm/test/Transforms/Util/PredicateInfo/testandor.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D94447.315925.patch
Type: text/x-patch
Size: 20668 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210111/857bff2e/attachment.bin>


More information about the llvm-commits mailing list