]> granicus.if.org Git - llvm/commit
[InstCombine] Propagate nsw flag when turning mul by pow2 into shift when the constan...
authorCraig Topper <craig.topper@gmail.com>
Tue, 27 Jun 2017 19:57:53 +0000 (19:57 +0000)
committerCraig Topper <craig.topper@gmail.com>
Tue, 27 Jun 2017 19:57:53 +0000 (19:57 +0000)
commitea86c526fbd455e7fb0b38066da50af0eb3344aa
treeafc24dc66cc093c81557fbf56d96463282a1a8e3
parentaa9b82348cbe2f856b0b9f0c70f27ae7756173a5
[InstCombine] Propagate nsw flag when turning mul by pow2 into shift when the constant is a vector splat or the scalar bit width is larger than 64-bits

The check to see if we can propagate the nsw flag used m_ConstantInt(uint64_t*&) which doesn't work with splat vectors and has a restriction that the bitwidth of the ConstantInt must be 64-bits are less.

This patch changes it to use m_APInt to remove both these issues

Differential Revision: https://reviews.llvm.org/D34699

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306457 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
test/Transforms/InstCombine/mul.ll