mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-16 11:24:39 +00:00
DAGCombine: clamp hi bit in APInt::getBitsSet to avoid assertion
rdar://12838504 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169951 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -7433,7 +7433,8 @@ SDValue DAGCombiner::ReduceLoadOpStoreWidth(SDNode *N) {
|
||||
// start at the previous one.
|
||||
if (ShAmt % NewBW)
|
||||
ShAmt = (((ShAmt + NewBW - 1) / NewBW) * NewBW) - NewBW;
|
||||
APInt Mask = APInt::getBitsSet(BitWidth, ShAmt, ShAmt + NewBW);
|
||||
APInt Mask = APInt::getBitsSet(BitWidth, ShAmt,
|
||||
std::min(BitWidth, ShAmt + NewBW));
|
||||
if ((Imm & Mask) == Imm) {
|
||||
APInt NewImm = (Imm & Mask).lshr(ShAmt).trunc(NewBW);
|
||||
if (Opc == ISD::AND)
|
||||
|
Reference in New Issue
Block a user