[PATCH] D77890: [ValueTracking] Implement isPoisonIf and canPushFreezeIntoOperands

Juneyoung Lee via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 10 12:53:58 PDT 2020


aqjune created this revision.
aqjune added reviewers: spatel, nikic, lebedev.ri.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

This PR implements two functions:

(1) isPoisonIf(V, ValAssumedPoison) is a function that returns true if V is poison under the assumption that
ValAssumedPoison is poison.

isPoisonIf can be used for sound optimization of select, as discussed in D77868 <https://reviews.llvm.org/D77868>.

(2) canPushFreezeIntoOperands(Instruction *I) returns true if I does not generate poison from non-poison
values, making freeze(op x y) -> (freeze x) (freeze y) valid.

canPushFreezeIntoOperands is used by isPoisonIf for more precise analysis.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D77890

Files:
  llvm/include/llvm/Analysis/ValueTracking.h
  llvm/lib/Analysis/ValueTracking.cpp
  llvm/unittests/Analysis/ValueTrackingTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77890.256632.patch
Type: text/x-patch
Size: 8470 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200410/ebd1200a/attachment.bin>


More information about the llvm-commits mailing list