Fix for PR 26356
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Thu, 4 Feb 2016 23:14:42 +0000 (23:14 +0000)
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>
Thu, 4 Feb 2016 23:14:42 +0000 (23:14 +0000)
commitb6fdce4ca0f35aabab76ed428552a7ee68518863
tree8b92f8880b414716ac1394f600190df61bfdc0fa
parent898acf9db8f9db5433ea6e3af58adfdceab38c67
Fix for PR 26356

Using the load immediate only when the immediate (whether signed or unsigned)
can fit in a 16-bit signed field. Namely, from -32768 to 32767 for signed and
0 to 65535 for unsigned. This patch also ensures that we sign-extend under the
right conditions.

llvm-svn: 259840
llvm/lib/Target/PowerPC/PPCFastISel.cpp
llvm/test/CodeGen/PowerPC/pr26356.ll [new file with mode: 0644]