[ValueTracking] fix bug computing isKnownToBeAPowerOfTwo() with arithmetic shift...
authorSanjay Patel <spatel@rotateright.com>
Wed, 30 Dec 2015 22:40:52 +0000 (22:40 +0000)
committerSanjay Patel <spatel@rotateright.com>
Wed, 30 Dec 2015 22:40:52 +0000 (22:40 +0000)
commit08e3bf995e6be976e55d34c1aace8370c61f68fb
tree6c201e3841a6d86dc951308829b9efb24aca0a63
parent04e678255f71d4a9ca731f57e46c723ad20a0117
[ValueTracking] fix bug computing isKnownToBeAPowerOfTwo() with arithmetic shift right (PR25900)

This is a fix for:
https://llvm.org/bugs/show_bug.cgi?id=25900

If we think that an arithmetic right shift of a power of two is always a power of two,
an sdiv gets wrongly converted to udiv.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256655 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Analysis/ValueTracking.cpp
test/Analysis/ValueTracking/known-power-of-two.ll [new file with mode: 0644]