[PowerPC] Fix transform in table gen file causing UB

Running a bootstrap build with UBSan produces a number of instances where
we have signed integer overflow due to this transform. Change the type to
long to prevent this UB on 64-bit build machines.

llvm-svn: 325347
This commit is contained in:
Nemanja Ivanovic 2018-02-16 14:49:01 +00:00
parent e44533b7f1
commit 6cf41b028d
1 changed files with 1 additions and 1 deletions

View File

@ -308,7 +308,7 @@ def HI16 : SDNodeXForm<imm, [{
def HA16 : SDNodeXForm<imm, [{
// Transformation function: shift the immediate value down into the low bits.
int Val = N->getZExtValue();
long Val = N->getZExtValue();
return getI32Imm((Val - (signed short)Val) >> 16, SDLoc(N));
}]>;
def MB : SDNodeXForm<imm, [{