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)
commite2a4b856d8da5d1119acffbd127f6ebe6db42677
tree5fff2c6705b3fbab5fe22e2cc5b3fa0c084235d2
parentd3b7582c8444e4bc78f4282d8911927a2b4283d1
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

llvm-svn: 232176
llvm/lib/IR/ConstantFold.cpp
llvm/test/Transforms/ConstProp/shift.ll [new file with mode: 0644]