Skip to content

Commit 0985a8b

Browse files
committed
Fix left shift overflow UB in PPC backend on LLP64 platforms
1 parent 7c6f28a commit 0985a8b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/PowerPC/PPCISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9189,7 +9189,7 @@ static SDValue getCanonicalConstSplat(uint64_t Val, unsigned SplatSize, EVT VT,
91899189
EVT ReqVT = VT != MVT::Other ? VT : VTys[SplatSize-1];
91909190

91919191
// For a splat with all ones, turn it to vspltisb 0xFF to canonicalize.
9192-
if (Val == ((1LU << (SplatSize * 8)) - 1)) {
9192+
if (Val == ((1LLU << (SplatSize * 8)) - 1)) {
91939193
SplatSize = 1;
91949194
Val = 0xFF;
91959195
}

0 commit comments

Comments
 (0)