[ValueTracking] readnone CallInsts are fair game for speculation
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 27 Aug 2015 23:03:01 +0000 (23:03 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 27 Aug 2015 23:03:01 +0000 (23:03 +0000)
commit2cdf5c3e038396a30afb2abafc0492fb137b1828
tree84ce47fd508202f58f1e56096c5ca3e497372ab7
parentef38201ab0ca8a4293e2df544ecf7a22ab47ea1e
[ValueTracking] readnone CallInsts are fair game for speculation

Any call which is side effect free is trivially OK to speculate.  We
already had similar logic in EarlyCSE and GVN but we were missing it
from isSafeToSpeculativelyExecute.

This fixes PR24601.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@246232 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ValueTracking.cpp
test/Transforms/SimplifyCFG/speculate-math.ll