Skip to content

Commit 7e187da

Browse files
author
Tony Varghese
committed
Added assert for unknown ShiftAmount and an early exit condition for FullValue of zeros and all ones
1 parent 2b809ad commit 7e187da

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15795,6 +15795,9 @@ SDValue PPCTargetLowering::combineBVLoadsSpecialValue(SDValue Op,
1579515795
FullVal |= ElemAPInt;
1579615796
}
1579715797

15798+
if (FullVal.isZero() || FullVal.isAllOnes())
15799+
return SDValue();
15800+
1579815801
if (auto UIMOpt = getPatternInfo(FullVal)) {
1579915802
const auto &[Uim, ShiftAmount] = *UIMOpt;
1580015803
SDLoc Dl(Op);
@@ -15810,6 +15813,8 @@ SDValue PPCTargetLowering::combineBVLoadsSpecialValue(SDValue Op,
1581015813
return LxvkqInstr;
1581115814
}
1581215815

15816+
assert(ShiftAmount == 127 && "Unexpected lxvkq shift amount value");
15817+
1581315818
// The right shifted pattern can be constructed using a combination of
1581415819
// XXSPLTIB and VSRQ instruction. VSRQ uses the shift amount from the lower
1581515820
// 7 bits of byte 15. This can be specified using XXSPLTIB with immediate

0 commit comments

Comments
 (0)