OSDN Git Service

The expression icmp eq (select (icmp eq x, 0), 1, x), 0 folds to false.
authorDuncan Sands <baldrick@free.fr>
Fri, 28 Oct 2011 19:01:20 +0000 (19:01 +0000)
committerDuncan Sands <baldrick@free.fr>
Fri, 28 Oct 2011 19:01:20 +0000 (19:01 +0000)
commit012f8547f70c7cefe552282f28581a434ebe7324
treea5bd039d949ceecf225351d88d4b3ba0f54fc72f
parent2ec69faf2615ccdffffacff9033b2228c589971c
The expression icmp eq (select (icmp eq x, 0), 1, x), 0 folds to false.
Spotted by my super-optimizer in 186.crafty and 450.soplex.  We really
need a proper infrastructure for handling generalizations of this kind
of thing (which occur a lot), however this case is so simple that I decided
to go ahead and implement it directly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143214 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/InstructionSimplify.cpp
test/Transforms/InstSimplify/compare.ll