[ValueTracking] teach computeKnownBits that a fabs() clears sign bits
authorSanjay Patel <spatel@rotateright.com>
Thu, 8 Oct 2015 16:56:55 +0000 (16:56 +0000)
committerSanjay Patel <spatel@rotateright.com>
Thu, 8 Oct 2015 16:56:55 +0000 (16:56 +0000)
commit1938c39ce4afd671ccf309f08233e2e3dfd8fcdc
treecad699564b842d7361d7d86e205aaf75230b525f
parent9ba45e98f4e3aa40c0d38643e1387fddb4004cc0
[ValueTracking] teach computeKnownBits that a fabs() clears sign bits

This was requested in D13076: if we're going to canonicalize to fabs(), ValueTracking
should know that fabs() clears sign bits.

In this patch (as in D13076), we're not handling vectors yet even though computeKnownBits'
fabs() case itself should be vector-ready via the splat in this patch.
Fixing this will require follow-on patches to correct other logic that uses 'getScalarType'.

Differential Revision: http://reviews.llvm.org/D13222

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@249701 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ValueTracking.cpp
test/Transforms/InstCombine/fabs.ll