summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
diff options
context:
space:
mode:
authorNemanja Ivanovic <nemanja.i.ibm@gmail.com>2018-05-03 01:04:13 +0000
committerNemanja Ivanovic <nemanja.i.ibm@gmail.com>2018-05-03 01:04:13 +0000
commit61ffbf21cdc92e1acc4794b75ea0c12e2caa9414 (patch)
tree7d97a9dbfe5095f6cc562e111831a8470e638051 /llvm/lib/Target/PowerPC/PPCISelLowering.cpp
parentb082a8790cee4aa37b623c83da773c2f00b4a588 (diff)
downloadbcm5719-llvm-61ffbf21cdc92e1acc4794b75ea0c12e2caa9414.tar.gz
bcm5719-llvm-61ffbf21cdc92e1acc4794b75ea0c12e2caa9414.zip
Commit r331416 breaks the big-endian PPC bot. On the big endian build, we
actually encounter constants wider than 64-bits. Add the guard to prevent tripping the assert. llvm-svn: 331420
Diffstat (limited to 'llvm/lib/Target/PowerPC/PPCISelLowering.cpp')
-rw-r--r--llvm/lib/Target/PowerPC/PPCISelLowering.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
index bea8792a039..cfe77f4e3e3 100644
--- a/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
+++ b/llvm/lib/Target/PowerPC/PPCISelLowering.cpp
@@ -13984,6 +13984,9 @@ isMaskAndCmp0FoldingBeneficial(const Instruction &AndI) const {
const Value *Mask = AndI.getOperand(1);
// If the mask is suitable for andi. or andis. we should sink the and.
if (const ConstantInt *CI = dyn_cast<ConstantInt>(Mask)) {
+ // Can't handle constants wider than 64-bits.
+ if (CI->getBitWidth() > 64)
+ return false;
int64_t ConstVal = CI->getZExtValue();
return isUInt<16>(ConstVal) ||
(isUInt<16>(ConstVal >> 16) && !(ConstVal & 0xFFFF));
OpenPOWER on IntegriCloud