OSDN Git Service

Merging r221318:
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 8 Dec 2014 09:16:46 +0000 (09:16 +0000)
committerWuZhen <wuzhen@jidemail.com>
Tue, 23 Feb 2016 11:27:26 +0000 (19:27 +0800)
commitfefe84b7a0bd7e86e7d222cd3695b2ced40944a9
tree43ea0b9fcf1ee591c06b7a0f0580beb3f44f758b
parent15dda250c52f72a8521af109004ba941d45822be
Merging r221318:
------------------------------------------------------------------------
r221318 | majnemer | 2014-11-04 15:49:08 -0800 (Tue, 04 Nov 2014) | 10 lines

Analysis: Make isSafeToSpeculativelyExecute fire less for divides

Divides and remainder operations do not behave like other operations
when they are given poison: they turn into undefined behavior.

It's really hard to know if the operands going into a div are or are not
poison.  Because of this, we should only choose to speculate if there
are constant operands which we can easily reason about.

This fixes PR21412.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223647 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ValueTracking.cpp
test/Transforms/LICM/speculate.ll