[llvm] r331420 - Commit r331416 breaks the big-endian PPC bot. On the big endian build, we

Nemanja Ivanovic via llvm-commits llvm-commits at lists.llvm.org
Wed May 2 18:04:13 PDT 2018


Author: nemanjai
Date: Wed May  2 18:04:13 2018
New Revision: 331420

URL: http://llvm.org/viewvc/llvm-project?rev=331420&view=rev
Log:
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.


Modified:
    llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp

Modified: llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp?rev=331420&r1=331419&r2=331420&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/PowerPC/PPCISelLowering.cpp Wed May  2 18:04:13 2018
@@ -13984,6 +13984,9 @@ isMaskAndCmp0FoldingBeneficial(const Ins
   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));




More information about the llvm-commits mailing list