Merging r221318:
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 8 Dec 2014 09:16:46 +0000 (09:16 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 8 Dec 2014 09:16:46 +0000 (09:16 +0000)
commit7c5cb20b302d29e8027c87a63618fc3e89b5c84d
treeb606bc826f7f50a6c2baa6fd0e16ffde6272d759
parent62e49039049ce24b462e6cd120a5cf23c8095cbb
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