Index: llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp =================================================================== --- llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp +++ llvm/trunk/lib/Target/AArch64/AArch64ISelDAGToDAG.cpp @@ -1512,7 +1512,7 @@ // Because of simplify-demanded-bits in DAGCombine, the mask may have been // simplified. Try to undo that - AndImm |= (1 << NumberOfIgnoredLowBits) - 1; + AndImm |= maskTrailingOnes(NumberOfIgnoredLowBits); // The immediate is a mask of the low bits iff imm & (imm+1) == 0 if (AndImm & (AndImm + 1))