diff options
author | Jun Bum Lim <junbuml@codeaurora.org> | 2016-02-11 15:50:07 +0000 |
---|---|---|
committer | Jun Bum Lim <junbuml@codeaurora.org> | 2016-02-11 15:50:07 +0000 |
commit | 339e9723c12dfc046b1493bb75891515127ff0ff (patch) | |
tree | dc9b7432e371db8ea8acbd7066171b8157ee7790 /clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp | |
parent | e3b963d5eea70d510e5ad5d852ce74a2642886e1 (diff) | |
download | llvm-339e9723c12dfc046b1493bb75891515127ff0ff.zip llvm-339e9723c12dfc046b1493bb75891515127ff0ff.tar.gz llvm-339e9723c12dfc046b1493bb75891515127ff0ff.tar.bz2 |
[InstCombine] Simplify a known nonzero incoming value of PHI
Summary:
When a PHI is used only to be compared with zero, it is possible to replace an
incoming value with any non-zero constant if the incoming value can be proved as
a known nonzero value. For example, in below code, we can replace the incoming value %v with
any non-zero constant based on the fact that the PHI is only used to be compared with zero
and %v is a known non-zero value:
%v = select %cond, 1, 2
%p = phi [%v, BB] ...
%c = icmp eq, %p, 0
Reviewers: mcrosier, jmolloy, sanjoy
Subscribers: hfinkel, mcrosier, majnemer, llvm-commits, haicheng, bmakam, mssimpso, gberry
Differential Revision: http://reviews.llvm.org/D16240
llvm-svn: 260530
Diffstat (limited to 'clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions