ConstantFold: Fix big shift constant folding
authorDavid Majnemer <david.majnemer@gmail.com>
Fri, 13 Mar 2015 16:39:46 +0000 (16:39 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Fri, 13 Mar 2015 16:39:46 +0000 (16:39 +0000)
commit790aec065174841b2a992f324854896cd1a473a2
treeb7dfab0aa48b61002e4cebf0d0f0508ef52d4d4c
parent547ba56bd0dd4dddf79f7db95263fd25d4c3827a
ConstantFold: Fix big shift constant folding

Constant folding for shift IR instructions ignores all bits above 32 of
second argument (shift amount).
Because of that, some undef results are not recognized and APInt can
raise an assert failure if second argument has more than 64 bits.

Patch by PaweÅ‚ Bylica!

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232176 91177308-0d34-0410-b5e6-96231b3b80d8
lib/IR/ConstantFold.cpp
test/Transforms/ConstProp/shift.ll [new file with mode: 0644]