[PATCH] D96945: [InstCombine] Add simplification of two logical and/ors

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 01:48:27 PST 2021


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

This is a patch that adds folding of two logical and/ors that share one variable:

a && (a && b) -> a && b
a && (a & b)  -> a && b
...

This is towards removing the poison-unsafe select optimization (D93065 <https://reviews.llvm.org/D93065> has more context).

Alive2 online is broken now; this is the output from my local machine: https://gist.github.com/aqjune/f5e4430286a259fc6577faa8f7afd97d
(validates the result of select-safe-bool-transforms.ll)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D96945

Files:
  llvm/include/llvm/IR/PatternMatch.h
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
  llvm/test/Transforms/InstCombine/select-safe-bool-transforms.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96945.324566.patch
Type: text/x-patch
Size: 7695 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210218/c95837d0/attachment.bin>


More information about the llvm-commits mailing list