[PATCH] D93840: [InstCombine] Disable unsafe select transform behind a flag

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 27 09:58:04 PST 2020


nikic created this revision.
nikic added reviewers: aqjune, spatel, lebedev.ri, congzhe.
Herald added a subscriber: hiraditya.
nikic requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

This disables the poison-unsafe select -> and/or transform behind a flag (we continue to perform the fold by default). This is intended to simplify testing while we add support for the select pattern. Otherwise, there's no way to test InstCombine-related changes, as InstCombine would just canonicalize it away.

This only disables the main select -> and/or transform. A number of related ones are instead changed to canonicalize to the a ? b : false and a ? true : b forms which represent and/or respectively. This requires a bit of care to avoid infinite loops, as we do not want !a ? b : false to be converted into a ? false : b.

The basic idea here is the same as D93065 <https://reviews.llvm.org/D93065>, this just keeps it behind a flag, and retains the canonicalizations.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D93840

Files:
  llvm/include/llvm/Transforms/InstCombine/InstCombiner.h
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/test/Transforms/InstCombine/select-and-or.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D93840.313791.patch
Type: text/x-patch
Size: 8605 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201227/7f6703b7/attachment.bin>


More information about the llvm-commits mailing list